diff --git a/docker/nginx.conf b/docker/nginx.conf index 3395d20..60c44f6 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -47,6 +47,9 @@ server { 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; } + # 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). location /data/ { add_header Cache-Control "no-cache"; try_files $uri =404; }