-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
35 lines (31 loc) · 1.26 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
server {
listen 8080;
location / {
root /usr/share/nginx/html;
# This is due to nginx and the try_files behavior below, it will always
# try to hit the index as part of try_files. If I set index as something
# that doesn't resolve, we don't have to worry about index.html being cached.
#
# If frequent updates occur, it's important that index.html not be cached
# in the browser. Otherwise the software update will only occur when the
# cached page expires. The If-Modified-Since is a better way to handle this
# for SPAs with frequent updates.
index unresolvable-file-html.html;
try_files $uri @index;
}
# This seperate location is so the no cache policy only applies to the index and nothing else.
location @index {
root /usr/share/nginx/html;
add_header Cache-Control no-cache;
expires 0;
try_files /index.html =404;
}
location /odp/ {
proxy_set_header Referer "https://opentransportdata.swiss";
proxy_pass https://opentransportdata.swiss/;
}
location /odp-siri/ {
proxy_set_header Authorization "Bearer ${ODP_TOKEN}";
proxy_pass https://api.opentransportdata.swiss/;
}
}