Perl + fcgi + nginx - what am I doing wrong?

youradds nginx-forum at nginx.us
Fri Jul 31 12:55:44 UTC 2015


Hi,

I've already got a live + dev site running under nginx and perl (with fcgi),
but I can't for the life of me work out why its not working this time
around. I've setup a new dev server. I wont bore you with all of the
details, but suffice to say I have installed (via apt-get);

    sudo apt-get update && sudo apt-get upgrade
    sudo apt-get install nginx
    sudo apt-get install php5-cli php5-cgi spawn-fcgi php-pear
    sudo apt-get install mysql-server php5-mysql
    sudo apt-get install fcgiwrap

The OS is Debian 8.1.

I have then configured my site, using:

    server {
    
        listen   80;
    
        server_name site.net.net www.site.net.net;
        access_log /srv/www/site.net.net/logs/access.log;
        error_log /srv/www/site.net.net/logs/error.log;
        root /srv/www/site.net.net/www;
    
     location / {
            index  index.html index.htm;
        }
    
    	location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME
/srv/www/site.net.net/www$fastcgi_script_name;
    	}
    
    	location ~ \.cgi$ {
                try_files $uri =404;
                gzip off;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/run/fcgiwrap.socket;
                fastcgi_index index.cgi;
                fastcgi_param SCRIPT_FILENAME
/srv/www/site.net.net/www/cgi-bin/$fastcgi_script_name;
            }
    
    }

I've sym-linked the config files into sites-enabled, so that its visible on
nginx. I then rebooted nginx, and tried:

    index.html - works fine
    index.php - works fine
    index.cgi - 403 error

I managed to fumble my way through it last time, but I can't figure out what
I did different (I know it was a real pig to get configured the first time
around)

Any suggestions from the experts?

(appologies for the formatting of this post - can't figure out how to do
markup?)

TIA

Andy

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,260678,260678#msg-260678



More information about the nginx mailing list