Add proper headers for manifest and service worker in Nginx configuration

This commit is contained in:
MayaChat
2025-11-24 13:47:04 -05:00
parent 734c9dc70c
commit 8529602667

View File

@@ -44,6 +44,21 @@ http {
proxy_read_timeout 5s; proxy_read_timeout 5s;
} }
# Manifest with proper content type
location = /manifest.json {
root /usr/share/nginx/html;
add_header Content-Type application/manifest+json;
add_header Cache-Control "public, max-age=3600";
}
# Service worker with proper headers
location = /sw.js {
root /usr/share/nginx/html;
add_header Content-Type application/javascript;
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Service-Worker-Allowed "/";
}
# Serve static files # Serve static files
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;