-
Notifications
You must be signed in to change notification settings - Fork 33
/
default-site
41 lines (35 loc) · 1.21 KB
/
default-site
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
server {
listen 80;
server_name localhost;
root /var/www;
# Static
location / {
index index.html index.htm index.php;
}
# PHP scripts -> PHP-FPM server listening on 127.0.0.1:9000
location ~ \.php$ {
# The following line prevents malicious php code to be executed through some uploaded file (without php extension, like image)
# This fix shoudn't work though, if nginx and php are not on the same server, other options exist (like unauthorizing php execution within upload folder)
# More on this serious security concern in the "Pass Non-PHP Requests to PHP" section, there http://wiki.nginx.org/Pitfalls
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Security
location ~ /\.ht {
deny all;
}
# Stuffs
location = /favicon.ico {
access_log off;
return 204;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|xml)$ {
expires 30d;
#access_log off;
#set $memcached_key $uri;
#memcached_pass 127.0.0.1:11211;
}
}