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

Francis Daly francis at daoine.org
Fri Jul 31 22:23:24 UTC 2015


On Fri, Jul 31, 2015 at 02:55:02PM -0400, youradds wrote:

Hi there,

Good that you found and fixed the problem.

> I had:
> 
> fastcgi_param SCRIPT_FILENAME
> /srv/www/site.net/www/cgi-bin/$fastcgi_script_name;
> 
> but it wasn't in the cgi-bin!!!!It should have been:
> 
> fastcgi_param SCRIPT_FILENAME /srv/www/site.net/www/$fastcgi_script_name;
> 
> Reboot it, and it works fine now., That'd be whyit was 403'ing... as it
> couldn't find the file. Duh!

Note, you have

  try_files $uri =404;
  fastcgi_param SCRIPT_FILENAME /srv/www/site.net.net/www/cgi-bin/$fastcgi_script_name;

The first line says "return 404 unless the file $document_root$uri exists".

In general, if the second line does not also refer to exactly the filename
$document_root$uri, you should suspect a problem.

(It can validly refer to a different filename, but probably only where
the fastcgi server is inside a chroot area.)

When you come to use the cgi-bin directory, you'll want to be aware of that.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list