This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nginx.conf
195 lines (160 loc) · 5.9 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
resolver 8.8.8.8 valid=5s;
gzip on;
gzip_types
text/css
text/plain
text/xml
application/json
application/x-javascript
text/javascript
image/svg+xml
image/x-icon
;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
server {
listen 80;
server_name localhost;
root /var/www;
proxy_pass_request_headers on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
location /ide/ {
proxy_pass https://patience.studentrobotics.org/ide/;
}
location /forum/ {
proxy_pass https://patience.studentrobotics.org/forum/;
}
location /trac/ {
proxy_pass https://saffron.studentrobotics.org/trac/;
}
location /git/ {
proxy_pass https://saffron.studentrobotics.org/git/;
}
location /cgit/ {
proxy_pass https://saffron.studentrobotics.org/cgit/;
}
location /cgit-data/ {
proxy_pass https://saffron.studentrobotics.org/cgit-data/;
}
location /gerrit/ {
proxy_pass https://saffron.studentrobotics.org$request_uri;
}
location /docs/python/ {
proxy_pass https://patience.studentrobotics.org/docs/python/;
}
location /docs/ {
proxy_pass https://srobo.github.io/docs/;
proxy_set_header Host srobo.github.io;
}
location /userman/ {
proxy_pass https://patience.studentrobotics.org/userman/;
}
location /code-submitter/ {
proxy_pass https://patience.studentrobotics.org/code-submitter/;
}
location /piwik/ {
proxy_pass https://saffron.studentrobotics.org/piwik/;
}
location /robogit/ {
proxy_pass https://patience.studentrobotics.org/robogit/;
}
location /robogit-ro/ {
proxy_pass https://patience.studentrobotics.org/robogit-ro/;
}
location /comp-api/ {
proxy_pass https://srcomp.studentrobotics.org/comp-api/;
}
# During the competition we un-comment this block to override the homepage
# with the comeptition-specific one
# location = / {
# proxy_pass https://srobo.github.io/competition-website/comp/;
# proxy_set_header Host srobo.github.io;
#
# sub_filter "/competition-website/comp/" "/comp/";
# sub_filter_once off;
# sub_filter_last_modified on;
# # Tell GitHub that we want these pages to be sent to us uncompressed
# # otherwise the sub_filter above doesn't work. We'll compress it on the
# # way out anyway, so clients don't lose anything by us doing this.
# proxy_set_header Accept-Encoding "";
# }
# Provide access to the competition pages under the normal prefix
location /comp/ {
proxy_pass https://srobo.github.io/competition-website/comp/;
proxy_set_header Host srobo.github.io;
sub_filter "/competition-website/comp/" "/comp/";
sub_filter_once off;
sub_filter_last_modified on;
# Tell GitHub that we want these pages to be sent to us uncompressed
# otherwise the sub_filter above doesn't work. We'll compress it on the
# way out anyway, so clients don't lose anything by us doing this.
proxy_set_header Accept-Encoding "";
}
# Also provide access under the prefix which github insists on using
# so that the secondary resources (JS, CSS, etc.) load
location /competition-website/ {
proxy_pass https://srobo.github.io/competition-website/;
proxy_set_header Host srobo.github.io;
}
# Disable custom media consent endpoint
#location /mediaconsent/ {
# proxy_pass https://patience.studentrobotics.org/mediaconsent/;
#}
location /tickets/ {
proxy_pass https://patience.studentrobotics.org/tickets/;
}
location /ticket-api/ {
proxy_pass https://patience.studentrobotics.org/ticket-api/;
}
location /style/ {
proxy_pass https://srobo.github.io/style/;
proxy_set_header Host srobo.github.io;
}
location /runbook/ {
proxy_pass https://srobo.github.io/runbook/;
proxy_set_header Host srobo.github.io;
}
location /kitbook/ {
proxy_pass https://srobo.github.io/kitbook/;
proxy_set_header Host srobo.github.io;
}
rewrite ^/schools/how_to_enter /compete redirect;
rewrite ^/about/how_to_help /volunteer redirect;
rewrite ^/about/contactus /contact redirect;
rewrite ^/sponsors /contact redirect;
rewrite ^/about/sponsors /contact redirect;
rewrite ^/key_dates /events redirect;
rewrite ^/feed.php /feed.xml redirect;
rewrite ^/password /userman/ permanent;
rewrite ^/rules /docs/rules/ permanent;
location / {
proxy_pass https://srobo.github.io/website/;
proxy_set_header Host srobo.github.io;
# Work around github.io redirect issue (see above)
proxy_redirect http://srobo.github.io/website/ /;
proxy_redirect https://srobo.github.io/website/ /;
sub_filter "/website/" "/";
sub_filter_once off;
sub_filter_types application/xml text/calendar text/css; # in addition to text/html
sub_filter_last_modified on;
# Tell GitHub that we want these pages to be sent to us uncompressed
# otherwise the sub_filter above doesn't work. We'll compress it on the
# way out anyway, so clients don't lose anything by us doing this.
proxy_set_header Accept-Encoding "";
}
error_page 404 /404.html;
error_page 500 502 503 504 /error/index.html;
}
}