Fix nginx config to serve static assets correctly

Add /assets/ location block to serve JS/CSS with correct MIME types
instead of falling back to index.html.
This commit is contained in:
fullsizemalt 2026-01-09 01:24:41 -08:00
parent f6b9299d00
commit 6bdc23b9d3

View file

@ -30,6 +30,12 @@ server {
add_header Content-Disposition "attachment; filename=visitorkiosk.apk"; add_header Content-Disposition "attachment; filename=visitorkiosk.apk";
} }
# Static assets (JS, CSS, images, fonts)
location /assets/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Frontend SPA routing # Frontend SPA routing
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;