-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnginx.conf
More file actions
33 lines (29 loc) · 820 Bytes
/
nginx.conf
File metadata and controls
33 lines (29 loc) · 820 Bytes
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
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# MIME types
types {
text/html html htm;
application/json json;
application/manifest+json webmanifest;
text/javascript js;
image/webp webp;
image/png png;
}
# Service Worker: No caching
location = /sw.js {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
}
# Static assets: Long-term cache
location ~* \.(png|webp|ico)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# SPA/PWA routing support
location / {
try_files $uri $uri/ /index.html;
}
}