Try to fix nginx config on prod.

This commit is contained in:
InfoX 2026-10-03 20:44:58 +02:00
parent 85fd9de6ee
commit cf57049744
Signed by: infox
GPG key ID: 0C5A10019B6B50F6

View file

@ -47,6 +47,9 @@ server {
location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; }
location ~ ^/workbox-.*\.js$ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location ~ ^/workbox-.*\.js$ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; }
# The MapLibre worker is an ES module (.mjs); nginx's stock mime.types has no entry for it and module scripts need a JavaScript MIME type.
location ~ \.mjs$ { default_type text/javascript; add_header Cache-Control "no-cache"; try_files $uri =404; }
# Data files keep their names: revalidate (the service worker precaches them by content hash). # Data files keep their names: revalidate (the service worker precaches them by content hash).
location /data/ { add_header Cache-Control "no-cache"; try_files $uri =404; } location /data/ { add_header Cache-Control "no-cache"; try_files $uri =404; }