mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-13 12:17:24 +00:00
🐛(frontend) return real 404s for missing hashed assets
Nginx was rewriting missing `/assets/*` files to `index.html`, so requests for stale chunks got a 200 with the SPA shell served as a JS module. That is what turned a plain 404 into the confusing: "TypeError: error loading dynamically imported module" whenever a client loaded before a deployment requested an old chunk. Stop rewriting missing `/assets/*` to `index.html`: those requests now return a real 404 with `Cache-Control: no-store`. SPA route fallback for non-asset paths is unchanged.
This commit is contained in:
@@ -74,6 +74,13 @@ server {
|
||||
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
try_files $uri =404;
|
||||
error_page 404 = @asset_missing;
|
||||
}
|
||||
|
||||
location @asset_missing {
|
||||
add_header Cache-Control "no-store" always;
|
||||
return 404;
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
|
||||
@@ -14,6 +14,13 @@ server {
|
||||
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
try_files $uri =404;
|
||||
error_page 404 = @asset_missing;
|
||||
}
|
||||
|
||||
location @asset_missing {
|
||||
add_header Cache-Control "no-store" always;
|
||||
return 404;
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
|
||||
Reference in New Issue
Block a user