-
Notifications
You must be signed in to change notification settings - Fork 2
/
nginx.conf
44 lines (36 loc) · 1.3 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
server {
listen 80;
root /usr/share/nginx/html;
# enable gzip
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 4;
gzip_min_length 0;
gzip_types text/plain application/javascript text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype;
# in case ".../static/..." is part of the URL, rewrite to /static folder
# this is needed to handle page requests from folders e.g.: /resource/R100
# for this page, static files are served from: /resource/static/js/
location ~ /static {
expires 1y;
add_header Cache-Control "public, no-transform";
rewrite ^(.*)/static/(.*)$ /static/$2 break;
}
# for all static files that are not served from the /static folder
location ~ (__ENV.js|env\.js|manifest\.json|favicon\.ico) {
add_header Cache-Control "no-cache";
rewrite ^(.*)/(.*)\.(.*)$ /$2.$3 break;
}
# all remaining files to index.html
# disable cache for non-static files
location / {
add_header Cache-Control "no-cache";
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}