-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf.tmpl
43 lines (35 loc) · 1.14 KB
/
nginx.conf.tmpl
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
server {
listen 8080;
server_name localhost;
location ${SUBROUTE} {
root /usr/share/nginx/html;
index index.html;
try_files $uri ${SUBROUTE}/index.html;
# Ensure that non-versioned resources are checked
# with upstream before using the cached version.
add_header Cache-Control 'no-cache must-revalidate';
expires 0;
}
location ~ ${SUBROUTE}/favicon.* {
root /usr/share/nginx/html;
# Allow favicons to be cached, although for shorter periods.
add_header Cache-Control 'public';
expires 1M;
}
location ${SUBROUTE}/static {
root /usr/share/nginx/html;
# Allow versioned resources to be cached freely, since a modification
# would also change the file name (i.e. they are immutable).
add_header Cache-Control 'immutable';
expires 1y;
}
location ${SUBROUTE}/api/ {
add_header Cache-Control 'no-cache must-revalidate';
expires 0;
proxy_pass ${API_ENDPOINT};
}
location /healthz {
access_log off;
return 200 "healthy\n";
}
}