-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathphp.conf
24 lines (21 loc) · 1.12 KB
/
php.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#### nginx-globals - https://github.com/philcryer/nginx-globals
#### Don't pass uncontrolled requests to PHP
location ~ [^/]\.php(/|$) {
#fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_index index.php;
#### With PHP-FPM running on the same host, use the Unix socket, it should
#### be slightly faster than TCP, and it *will be* more secure (see below)
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
# Zero-day (or as the kids say O-day) exploit defense, per http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this server, which is possible
# with php-fpm/php-fcgi on :9000 (see above about using the socket) Comment the 'try_files'
# line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers
# that you won't get hacked :)
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_pass php;
#fastcgi_intercept_errors on;
}