2016-10-17 02:05:30 +00:00
|
|
|
##
|
|
|
|
## Default Host for http://localhost
|
|
|
|
##
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
# Root directive
|
|
|
|
root /var/www/default/htdocs;
|
|
|
|
index index.php;
|
|
|
|
|
|
|
|
access_log /var/log/nginx-stable/localhost-access.log main;
|
|
|
|
error_log /var/log/nginx-stable/localhost-error.log warn;
|
|
|
|
|
|
|
|
|
|
|
|
# Front-controller pattern as recommended by the nginx docs
|
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ /index.php;
|
|
|
|
}
|
|
|
|
|
|
|
|
# PHP FPM
|
|
|
|
location ~ \.php?$ {
|
|
|
|
# PHP.INI:
|
|
|
|
# ---------------------------
|
|
|
|
# // Find this:
|
|
|
|
# cgi.fix_pathinfo=1
|
|
|
|
# // Replace with:
|
|
|
|
# cgi.fix_pathinfo=0
|
|
|
|
|
|
|
|
try_files $uri = 404;
|
|
|
|
include fastcgi_params;
|
|
|
|
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
|
|
|
|
2016-10-19 08:55:15 +00:00
|
|
|
#### FPM Server
|
2016-10-17 02:05:30 +00:00
|
|
|
fastcgi_pass 172.16.238.11:9000;
|
|
|
|
|
|
|
|
fastcgi_index index.php;
|
|
|
|
fastcgi_intercept_errors on;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# deny access to .htaccess files, if Apache's document root
|
|
|
|
# concurs with nginx's one
|
|
|
|
location ~ /\.ht {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
|
|
|
# disallow access to git configs path
|
|
|
|
location ~ /\.git {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
}
|