我见过很多教程,展示了如何通过各种FCGIstream程在nginx上设置PHP / Python / Perl / RoR 。
我find的教程都没有展示如何在一台服务器上提供多个FCGI服务。
如何configuration稳定的nginx(nginx-0.7.64)来为多个FCGI进程(每个上述语言一个)提供服务?
每个FCGI过程的示例地址如下所示:
127.0.0.1:8080 - PHP 127.0.0.1:8081 - Python 127.0.0.1:8082 - Perl 127.0.0.1:8083 - Ruby on Rails
一个示例configuration文件显示了如何实现多个FCGI的closures一台服务器是我真正需要的。 也许其他人也会受益。
只是改变:
location / { FCGI..PARAMETERS (find on the web) }
至:
location /python/ { python FCGI..PARAMETERS (find on the web) } location /php/ { php FCGI..PARAMETERS (find on the web) } location /perl/ { perl FCGI..PARAMETERS (find on the web) - although nginx supports it embedded. } location /ror/ { ror FCGI..PARAMETERS (find on the web) }
在/ var / www / nginx-default / – >下创build上面的文件夹,python / php / perl / ror,每个FCGI进程都会根据FCGIconfiguration提供不同的服务 – >将需要执行的文件他们一个运行fcgi进程+重启nginx。