-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-site.conf
47 lines (34 loc) · 1.15 KB
/
nginx-site.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
server {
listen 80;
### map sub-directories to sub-domains
server_name ~^(?<subdomain>.+)?\.domain\.com$;
root /var/www/domain.com/$subdomain;
# ssl_certificate;
# ssl_certificate_key;
ssl_protocols TLSv1.2;
index index.html index.htm index.php;
charset utf-8;
location / {
add_header X-App-Server SERVER-01 always;
### handy when testing nginx config ###
#add_header Content-Type text/plain;
#return 200 $http_host$uri;
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/domain.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
add_header X-App-Server SERVER-01 always;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
### should be actual path to your unix sock
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\. {
deny all;
}
}