I'm trying to get the latest nginx running alongside Perl. I know Perl itself is installed, as I can run test.cgi
perfectly from the command line. However, when trying to run from the browser I get a "502 Bad Gateway" error.
Below is my current config:
server {
listen 80;
server_name mysite.net www.mysite.net;
access_log /srv/www/mysite.net/logs/access.log;
error_log /srv/www/mysite.net/logs/error.log;
root /srv/www/mysite.net/www;
location / {
root /srv/www/mysite.net/www;
index index.html index.htm index.php;
}
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/mysite.net/www$fastcgi_script_name;
}
location ~ \.cgi$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME /srv/www/mysite.net/cgi-bin$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
Any suggestions? I've got everything else I need working (PHP, nginx itself, SFTP etc), but I can't for the life of me get nginx and Perl to play nice.
Here is the tutorial I have followed to get up to this point:
As far as I'm aware, I have done exactly what it says.