/
nw.local.nginx
88 lines (70 loc) · 1.83 KB
/
nw.local.nginx
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
server {
server_name nw.local localhost;
listen 8765;
root /tmp/root/deploy/www;
charset utf-8;
#error_page 404 /404.html;
error_page 404 /404.php;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
# Just use generic nginx error pages for now
location = /50x.html {
root /usr/share/nginx/html;
}
location = /favicon.ico {
try_files /dev_favicon.ico =404;
}
# Debugging on settings
log_not_found on;
#autoindex on;
rewrite_log on;
add_header X-uri "$uri";
location ~ ^/(js|css|images|files)/ {
rewrite "^/(.*)\.[\d]{10,12}\.(.*)$" /$1.$2;
expires 365d;
try_files $uri =404;
}
location / {
#default fallback of everything else block
try_files $uri @php;
}
location = /npc.php {
return 302 /npc/;
}
location = /news.php {
return 301 /news/;
}
location = /account_issues.php {
return 302 /assistance;
}
location = /confirm.php {
return 302 /assistance/confirm$is_args$args;
}
location = /resetpassword.php {
return 302 /assistance$is_args$args;
}
location ~ ^/(main\.php|tutorial\.php) {
return 302 /intro;
}
location = /index.php {
return 302 /;
}
location = /list_all_players.php {
return 302 /list$is_args$args;
}
location ^~ /webgame {
rewrite ^ / permanent;
}
location ~ \.php$ {
fastcgi_param PHP_VALUE "session.cookie_domain= \n date.timezone=America/New_York \n default_charset=UTF-8 \n";
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/front-controller.php;
include fastcgi_params;
}
location @php {
fastcgi_param PHP_VALUE "session.cookie_domain= \n date.timezone=America/New_York \n default_charset=UTF-8 \n";
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/front-controller.php;
include fastcgi_params;
}
}