Compare commits

...

1 Commits

Author SHA1 Message Date
Adrian 93d3935197 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:13:19 +01:00
3 changed files with 24 additions and 20 deletions

View File

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

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; root /usr/share/nginx/html;
# redirect server error pages to the static page /50x.html # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
location = /50x.html {
# internal redirect # PHP processing
}
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm.sock; fastcgi_pass unix:/run/php5-fpm.sock;
include fastcgi.conf; include fastcgi.conf;
fastcgi_intercept_errors on; 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;
}
} }