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

Francis Daly francis at
Fri Jul 31 16:00:40 UTC 2015

On Fri, Jul 31, 2015 at 08:55:44AM -0400, youradds wrote:

Hi there,

> 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.

What is shown when you "diff" the working old nginx.conf and the failing
new nginx.conf?

Do the old and new use the same fastcgi server? Are there any differences
in the fastcgi server config?

>     	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/$fastcgi_script_name;
>             }

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

What file on your filesystem do you want the fasctcgi server to process
when you request this index.cgi? -- your server layout.

What SCRIPT_FILENAME value(s) does nginx send to your fastcgi server? --
nginx debug logs, or watch the traffic.

(Does your fastcgi server even use SCRIPT_FILENAME? -- your fastcgi
server documentation.)

Is SCRIPT_FILENAME set in your /etc/nginx/fastcgi_params?

Francis Daly        francis at

More information about the nginx mailing list