-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
55 lines (42 loc) · 1.35 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
events {
worker_connections 1024;
}
http {
include mime.types;
types {
application/manifest+json webmanifest;
}
sendfile on;
server {
listen 8080;
listen [::]:8080;
autoindex off;
server_name _;
server_tokens off;
access_log off;
# error_log off;
gzip_static on;
root /usr/share/nginx/html;
# all assets contain hash in filename, cache forever
location ^~ /assets/ {
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
}
location /locales/ {
add_header Cache-Control "public, max-age=300, s-maxage=300, immutable";
try_files $uri =404;
}
# all workbox scripts are compiled with hash in filename, cache forever
location ^~ /workbox- {
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
}
# assume that everything else is handled by the application router, by injecting the index.html.
location / {
autoindex off;
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
try_files $uri /index.html =404;
}
}
}