diff --git a/docker/resume/nginx.conf b/docker/resume/nginx.conf index c94860c..b92ab57 100644 --- a/docker/resume/nginx.conf +++ b/docker/resume/nginx.conf @@ -1,7 +1,4 @@ # Use $request_id as a pseudo-nonce for Content Security Policy (CSP) -# $request_id is unique per request and will serve as a nonce value here. - -# Map $request_id to a variable named $nonce map $request_id $nonce { default "$request_id"; } @@ -18,22 +15,22 @@ server { add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), accelerometer=(), gyroscope=(), magnetometer=(), payment=(), usb=()" always; - # Content Security Policy (CSP) with injected $nonce for script-src - # Allows inline scripts that match the nonce generated for each request - add_header Content-Security-Policy "default-src 'none'; script-src 'self' 'nonce-$nonce' https://matomo.nixc.us; style-src 'self' 'unsafe-inline' https://colinknapp.com; img-src 'self' https://matomo.nixc.us https://colinknapp.com https://hedgedoc.nixc.us; font-src 'self' data:; frame-ancestors 'self'; base-uri 'self'; form-action 'self';" always; + # Content Security Policy (CSP) with injected $nonce for script-src and style-src + # Allows inline scripts and styles that match the nonce generated for each request + add_header Content-Security-Policy "default-src 'none'; script-src 'self' 'nonce-$nonce' https://matomo.nixc.us; style-src 'self' 'nonce-$nonce' https://colinknapp.com; img-src 'self' https://matomo.nixc.us https://colinknapp.com https://hedgedoc.nixc.us; font-src 'self' data:; frame-ancestors 'self'; base-uri 'self'; form-action 'self';" always; # Cross-origin isolation headers add_header Cross-Origin-Embedder-Policy "require-corp" always; add_header Cross-Origin-Resource-Policy "same-origin" always; add_header Cross-Origin-Opener-Policy "same-origin" always; - # Use sub_filter to inject the nonce into inline