-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx_mertd
More file actions
46 lines (40 loc) · 1.08 KB
/
nginx_mertd
File metadata and controls
46 lines (40 loc) · 1.08 KB
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
upstream mertd {
server 127.0.0.1:8000;
}
server {
listen 80;
server_name www.mertd.com;
rewrite ^/(.*) http://mertd.com/$1 permanent;
}
server {
listen 80;
server_name mertd.com;
client_max_body_size 25M;
root /home/mertd/www/mertd/current/public/;
access_log /home/mertd/www/mertd/current/log/access.log main;
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html last;
break;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_max_temp_file_size 0;
if (-f $request_filename) {
break;
}
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (!-f $request_filename) {
proxy_pass http://mertd;
break;
}
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /home/mertd/www/mertd/current/public;
}
}