-
Notifications
You must be signed in to change notification settings - Fork 1
/
guestbook.nginx.conf
39 lines (30 loc) · 1.05 KB
/
guestbook.nginx.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
server {
listen 80;
server_name guestbook.example.com;
server_tokens off;
access_log /webdata/logs/guestbook.example.com.access.log;
error_log /webdata/logs/guestbook.example.com.error.log;
# read this: http://docs.ngx.cc/en/latest/topics/tutorials/config_pitfalls.html
root /www/guestbook.example.com;
# failsafe: http://saynt2day.blogspot.ru/2013/03/danger-of-trailing-dot-in-domain-name.html
if ($http_host != 'guestbook.example.com') {
rewrite ^/(.*)$ http://guestbook.example.com/$1 permanent;
}
# site installation
location / {
index guestbook.php;
rewrite ^(.+)$ /guestbook.php$1 last;
}
location /static/ {
expires 14d;
autoindex off;
}
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ ^/guestbook.php
{
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /www/guestbook.example.com/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}