Add proper headers for manifest and service worker in Nginx configuration
This commit is contained in:
15
nginx.conf
15
nginx.conf
@@ -44,6 +44,21 @@ http {
|
||||
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
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
Reference in New Issue
Block a user