Windows下配置nginx+FastCgi + Spawn-fcgi

Posted 力为

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows下配置nginx+FastCgi + Spawn-fcgi相关的知识,希望对你有一定的参考价值。

前提:

下载nginx, FastCgi, Spawn-fcgi

Spawn-fcgi有个Windows的版本,但不能在VS中编译,这里有一个编译好的版本:http://download.csdn.net/detail/mythma/8589405


FastCgi程序

这里使用echo-cpp。

把exe复制到nginx的cgi-bin目录中。


nginx配置:

在nginx.conf的server字段 中加上fastcgi程序的目录。

        location = /echo-cpp 
            fastcgi_pass 127.0.0.1:8081;
            fastcgi_index index.cgi;
            include fastcgi.conf;
        

使用spawn-fcgi启动echo-cpp:

spawn-fcgi -f ./cgi-bin/echo-cpp.exe -a 127.0.0.1 -p 8081


启动nginx

输入测试地址

http://localhost:9980/echo-cpp


以上是关于Windows下配置nginx+FastCgi + Spawn-fcgi的主要内容,如果未能解决你的问题,请参考以下文章

Windows下Nginx+Web.py+FastCGI服务搭建

windows下隐藏HTTP 头文件中nginx的版本号

Windows下配置Nginx+php7

nginx中fastcgi_params配置参数

解决ThinkPhp在nginx下404问题

nginx FastCGI模块(FastCGI)配置