-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsite.conf
40 lines (34 loc) · 1.03 KB
/
site.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
upstream api {
# reference to kubernetes/docker-compose service
server api:5000;
}
# simple nginx configuration file
server {
listen 80;
root /usr/share/nginx/html;
# Proxy api
location /api {
rewrite ^/api/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
proxy_pass http://api/;
}
# Serve front
location / {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header ETag "";
}
# service-worker should not be cached by browser - https://github.com/topheman/docker-experiments/blob/master/front/README.cra.md#offline-first-considerations
location /service-worker.js {
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
}