This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
159 lines (129 loc) · 3.99 KB
/
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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
worker_processes 10;
events { worker_connections 1024; }
http {
upstream v3 { server v3:8080; }
log_format apm '"$time_local" client=$remote_addr '
'method=$request_method request="$request" '
'request_length=$request_length '
'status=$status bytes_sent=$bytes_sent '
'body_bytes_sent=$body_bytes_sent '
'referer=$http_referer '
'user_agent="$http_user_agent" '
'upstream_addr=$upstream_addr '
'upstream_status=$upstream_status '
'request_time=$request_time '
'upstream_response_time=$upstream_response_time '
'upstream_connect_time=$upstream_connect_time '
'upstream_header_time=$upstream_header_time';
# Root to www redirect
server {
listen 80;
listen [::]:80;
access_log /var/log/nginx/access.log apm;
server_name 29th.org 29th.xyz 29th.local;
return 301 $scheme://www.$host$request_uri;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
access_log /var/log/nginx/access.log apm;
location /a3 {
proxy_pass https://29th.dreamhosters.com/a3;
proxy_redirect off;
}
location /awards {
proxy_pass https://29th.dreamhosters.com/awards;
proxy_redirect off;
}
location /bans {
return 301 https://forums.29th.org/discussion/25818/how-to-dispute-your-ban;
}
location /coats {
proxy_pass https://29th.dreamhosters.com/coats;
proxy_redirect off;
}
location /darkest-hour-infobank {
proxy_pass https://29th.github.io/darkest-hour-infobank/;
proxy_intercept_errors on;
expires off;
proxy_set_header Host 29th.github.io;
proxy_redirect off;
}
location /dh {
return 302 /darkest-hour-infobank/$arg_title;
proxy_redirect off;
}
location /forums {
proxy_pass https://29th.dreamhosters.com/forums;
proxy_redirect off;
}
location /ForumPostImages {
proxy_pass https://29th.dreamhosters.com/ForumPostImages;
proxy_redirect off;
}
location /handbook {
proxy_pass https://29th.dreamhosters.com/handbook;
proxy_redirect off;
}
location /images {
proxy_pass https://29th.dreamhosters.com/images;
proxy_redirect off;
}
location /medical {
proxy_pass https://29th.dreamhosters.com/medical;
proxy_redirect off;
}
location /roid {
proxy_pass https://29th.dreamhosters.com/roid;
proxy_buffers 16 4k;
proxy_buffer_size 2k;
proxy_redirect off;
}
location /rs {
proxy_pass https://29th.dreamhosters.com/rs;
proxy_redirect off;
}
location /signalcorps {
proxy_pass https://29th.dreamhosters.com/signalcorps;
proxy_redirect off;
}
location /sigs {
proxy_pass https://29th.dreamhosters.com/sigs;
proxy_redirect off;
}
location /stamps {
proxy_pass https://29th.dreamhosters.com/stamps;
proxy_redirect off;
}
location /wiki/index.php {
return 302 /wiki/$arg_title;
proxy_redirect off;
}
location /wiki {
proxy_pass https://29th.github.io/wiki/;
proxy_intercept_errors on;
expires off;
proxy_set_header Host 29th.github.io;
proxy_redirect off;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://v3;
}
}
# for nginx amplify monitoring
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
}