multiple *.fcgi in /cgi-bin/ directory - binding
Rakesh S
rakesh.usenet at gmail.com
Mon Jun 20 16:50:36 MSD 2011
While trying to configure fastcgi with nginx, here are the steps that
I have followed so far:
In /etc/nginx/nginx.conf:
server {
localhost 127.0.01;
..
..
location ~ ^/cgi-bin/.*\.fcgi$ {
root /srv/prod/bin;
include /etc/nginx/fastcgi.conf;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/user.socket;
}
}
/etc/nginx/fastcgi.conf:
cat /etc/nginx/fastcgi.conf
fastcgi_param SCRIPT_FILENAME /srv/prod/bin$fastcgi_script_name;
.
.
<other default values in place>
The fcgi script is now bind using the unix socket as follows:
# spawn-fcgi -s /tmp/user.socket -a 127.0.0.1 -p 9000 [ -u <user> -g
<user> -U <socketuser> -G <socketgroup> ]
This works fine for a given .fcgi script.
If I have 4 such scripts in the cgi-bin directory ( /srv/prod/bin) ,
should I be doing 4 such independent spawn-fcgi-s . Is there an
alternative to do the same ?
Related, these .fcgi mentioned are executables of a C++ program.
Any suggestions for a better installation / best practices here ? Thanks !
More information about the nginx
mailing list