mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-10 10:47:20 +00:00
61e8b597dc
The wasm and js files shipped by MediaPipe were served with different cache policies, which could leave the two out of sync on the client (fresh js with stale wasm, or vice versa). Align the cache configuration across the MediaPipe assets so they are always cached and invalidated together.
91 lines
2.9 KiB
Plaintext
91 lines
2.9 KiB
Plaintext
server {
|
|
listen 8080;
|
|
server_name localhost;
|
|
server_tokens off;
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
location = /.well-known/windows-app-web-link {
|
|
default_type application/json;
|
|
alias /usr/share/nginx/html/.well-known/windows-app-web-link;
|
|
add_header Content-Disposition "attachment; filename=windows-app-web-link";
|
|
}
|
|
|
|
# Manifest — fetched, never iframed
|
|
location = /addons/outlook/manifest.xml {
|
|
alias /usr/share/nginx/html/addons/outlook/manifest.xml;
|
|
|
|
add_header Access-Control-Allow-Origin "*";
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header X-Frame-Options "DENY";
|
|
add_header Content-Security-Policy "frame-ancestors 'none'";
|
|
}
|
|
|
|
location = /addons/outlook/assets/ {
|
|
return 404;
|
|
}
|
|
|
|
location ~* ^/addons/outlook/assets/(.+\.(?:css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot))/?$ {
|
|
root /usr/share/nginx/html;
|
|
expires 30d;
|
|
add_header Cache-Control "public, max-age=2592000, immutable" always;
|
|
add_header Access-Control-Allow-Origin "*";
|
|
add_header Vary "Origin" always;
|
|
}
|
|
|
|
location = /addons/outlook/ {
|
|
return 404;
|
|
}
|
|
|
|
location ~ ^/addons/outlook(/.*)?$ {
|
|
alias /usr/share/nginx/html/addons/outlook$1;
|
|
error_page 404 =200 /index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header Pragma "no-cache" always;
|
|
add_header Expires 0 always;
|
|
|
|
set $ms_domains "https://*.live.com https://*.office.com https://*.microsoft.com https://*.office365.com https://*.sharepoint.com";
|
|
|
|
set $nonce $request_id;
|
|
|
|
set $csp "default-src 'self'; upgrade-insecure-requests; ";
|
|
set $csp "${csp}frame-ancestors ${ms_domains}; ";
|
|
set $csp "${csp}script-src 'nonce-${nonce}' 'strict-dynamic'; ";
|
|
set $csp "${csp}style-src 'self' 'unsafe-inline'; ";
|
|
set $csp "${csp}img-src 'self' data:; ";
|
|
set $csp "${csp}font-src 'self' data:; ";
|
|
set $csp "${csp}connect-src 'self' ${ms_domains}; ";
|
|
set $csp "${csp}frame-src 'none'; ";
|
|
set $csp "${csp}object-src 'none'; ";
|
|
set $csp "${csp}base-uri 'none'; ";
|
|
|
|
add_header Content-Security-Policy $csp;
|
|
|
|
sub_filter 'NONCE_PLACEHOLDER' $nonce;
|
|
sub_filter_once off;
|
|
}
|
|
|
|
location ^~ /assets/mediapipe/wasm/ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
}
|
|
|
|
# Serve static files with caching
|
|
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";
|
|
}
|
|
|
|
# Serve static files
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
# Add no-cache headers
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
add_header Pragma "no-cache"; # HTTP 1.0 header for backward compatibility
|
|
add_header Expires 0;
|
|
}
|
|
|
|
# Optionally, handle 404 errors by redirecting to index.html
|
|
error_page 404 =200 /index.html;
|
|
}
|