Compare commits

...

1 Commits

Author SHA1 Message Date
Adrian 4aa3368c43 Nginx config: Replace CGI host with includable config
`SCRIPT_NAME` was removed because `alias` sets `$request_filename`
to the full path. Let's hope it works...
2015-12-14 01:08:09 +01:00
3 changed files with 22 additions and 20 deletions

View File

@ -0,0 +1,4 @@
fastcgi_pass unix:/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /etc/nginx/cgi-bin.php;
fastcgi_param X_SCRIPT_FILENAME $request_filename;

View File

@ -1,15 +0,0 @@
server {
listen 127.0.0.1:80;
root /usr/local/share/cgi-bin;
location ~ \.(cgi|pl|py|rb|sh)$ {
fastcgi_pass unix:/run/php-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /etc/nginx/cgi-bin.php;
fastcgi_param SCRIPT_NAME /cgi-bin.php;
fastcgi_param X_SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param X_SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SERVER_NAME $http_host;
}
}

View File

@ -8,15 +8,28 @@ server {
root /usr/share/nginx/html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
# internal redirect
}
# PHP processing
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_pass unix:/run/php5-fpm.sock;
include fastcgi.conf;
fastcgi_intercept_errors on;
}
# AWstats
location /awstats {
# You may want to secure this location by appending a random string
alias /usr/local/awstats/wwwroot/cgi-bin;
access_log off;
include inc/cgi-bin;
}
location /awstatsicons {
alias /usr/local/awstats/wwwroot/icon;
access_log off;
}
}