-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
27 lines (24 loc) · 879 Bytes
/
Copy pathnginx.conf
File metadata and controls
27 lines (24 loc) · 879 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
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Never cache index.html, sw.js, manifest.webmanifest or service worker assets
location ~* (index\.html|sw\.js|registerSW\.js|manifest\.webmanifest|workbox-.*\.js)$ {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
# Static assets with hash (js, css, images, fonts) can be cached long-term
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# SPA fallback — let Vue Router handle client-side routes
location / {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
try_files $uri $uri/ /index.html;
}
}