File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ ARG BUILD_TARGET
1818
1919COPY --from=builder /build/$BUILD_TARGET/ /usr/share/nginx/html
2020COPY nginx.conf /etc/nginx/nginx.conf
21+ COPY csp-headers.conf /etc/nginx/csp-headers.conf
Original file line number Diff line number Diff line change 1+ # Included from each location block that sets Cache-Control (nginx does not inherit
2+ # add_header from http/server when a location defines its own add_header).
3+ add_header Content-Security-Policy "default-src 'self' https://*.isaaccomputerscience.org; object-src 'none'; frame-src 'self' https://*.isaaccomputerscience.org https://www.youtube.com https://www.youtube-nocookie.com https://www.google.com https://www.gstatic.com https://fast.wistia.net; img-src 'self' data: https://cdn-cookieyes.com https://*.isaaccomputerscience.org https://*.google-analytics.com https://*.googletagmanager.com https://*.tile.openstreetmap.org https://developers.google.com https://i.ytimg.com/; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://*.isaaccomputerscience.org https://fonts.gstatic.com; connect-src 'self' wss://*.isaaccomputerscience.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.cookieyes.com https://cdn-cookieyes.com; script-src 'self' https://*.isaaccomputerscience.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://www.youtube-nocookie.com https://www.youtube.com https://www.google.com https://www.gstatic.com https://cdn-cookieyes.com https://fast.wistia.net https://embedwistia-a.akamaihd.net" always;
Original file line number Diff line number Diff line change @@ -50,24 +50,28 @@ http {
5050 location /assets {
5151 # Strongly cache these things for at least 30 days:
5252 add_header Cache-Control "public, max-age=2592000, no-transform" ;
53+ include /etc/nginx/csp-headers.conf;
5354 try_files $uri @default;
5455 }
5556
5657 location /static {
5758 # Maybe also strongly cache these things for at least 30 days?
5859 add_header Cache-Control "public, max-age=2592000, no-transform" ;
60+ include /etc/nginx/csp-headers.conf;
5961 try_files $uri @default;
6062 }
6163
6264 location /index .html {
6365 # Index pages, and also serves unknown URLs too from @default.
6466 # Do not allow caching of these index pages at all:
6567 add_header Cache-Control "no-cache, no-store, must-revalidate" ;
68+ include /etc/nginx/csp-headers.conf;
6669 try_files $uri @default;
6770 }
6871
6972 location ~ ^/unsupported_browser.( html|js) $ {
7073 add_header Cache-Control "no-cache, no-store, must-revalidate" ;
74+ include /etc/nginx/csp-headers.conf;
7175 try_files $uri @default;
7276 }
7377
7882 }
7983 # Allow caching, but require revalidation every time:
8084 add_header Cache-Control "no-cache, must-revalidate" ;
85+ include /etc/nginx/csp-headers.conf;
8186 try_files $uri @default;
8287 }
8388
You can’t perform that action at this time.
0 commit comments