fix(coolify): add Traefik routing labels, coolify network, and zero-cache CDN headers
This commit is contained in:
+20
-9
@@ -17,20 +17,31 @@ server {
|
||||
add_header X-Content-Type-Options "nosniff";
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
|
||||
# HTML pages must NEVER be cached by browser/CDN
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Cache Service Worker with no-cache so updates apply immediately
|
||||
location = /sw.js {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
}
|
||||
|
||||
# Static assets cache
|
||||
location ~* \.(css|js|json|svg|png|jpg|jpeg|ico)$ {
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, max-age=604800, immutable";
|
||||
# Cache Service Worker with no-cache so updates apply immediately
|
||||
location = /sw.js {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
}
|
||||
|
||||
# Static assets with revalidation
|
||||
location ~* \.(css|js|json)$ {
|
||||
add_header Cache-Control "no-cache, must-revalidate, max-age=0";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
}
|
||||
|
||||
# Images & icons
|
||||
location ~* \.(svg|png|jpg|jpeg|ico|webp)$ {
|
||||
expires 1d;
|
||||
add_header Cache-Control "public, max-age=86400";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user