@@ -5,23 +5,35 @@ server {
5
5
server_name _;
6
6
7
7
location / {
8
- set $CSP "default-src 'self' 'unsafe-inline' newara.sparcs.org blob: "; # Default rules for new-ara
9
- set $CSP "${CSP}*.googleapis.com *.gstatic.com https://www.google-analytics.com "; # Default rules for google fonts, google analytics
10
- set $CSP "${CSP}https://analytics.google.com; "; # Default rules for google analytics
11
- set $CSP "${CSP}object-src 'self'; "; # Disallow Objects
8
+ # See this link for more information about CSP
9
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
10
+ # https://content-security-policy.com/
11
+ set $CSP "default-src 'self' 'unsafe-inline' newara.sparcs.org "; # Default rules for new-ara
12
+ set $CSP "${CSP}*.channel.io *.cdninstagram.com "; # Default rules for channeltalk
13
+ set $CSP "${CSP}blob: *.googleapis.com *.gstatic.com "; # Default rules for google fonts, google analytics
14
+ set $CSP "${CSP}https://www.google-analytics.com https://analytics.google.com; "; # Default rules for google analytics
15
+
16
+ set $CSP "${CSP}object-src 'self'; "; # Disallow Objects
17
+ set $CSP "${CSP}connect-src 'self' *.channel.io *.sentry.io wss://*.channel.io "; # Connect rules for channeltalk (1/2)
18
+ set $CSP "${CSP}wss://*.desk-ws.channel.io wss://*.front-ws.channel.io "; # Connect rules for channeltalk (2/2)
19
+ set $CSP "${CSP}https://www.google-analytics.com https://analytics.google.com; "; # Connect rules for google analytics
20
+
12
21
set $CSP "${CSP}img-src * data: blob:; "; # Image rules for new-ara (allow all, data, blobs)
22
+
13
23
set $CSP "${CSP}script-src 'self' "; # Script rules for new-ara
24
+ set $CSP "${CSP}*.channel.io *.sentry-cdn.com "; # Script rules for channeltalk
14
25
set $CSP "${CSP}*.googleapis.com https://www.google-analytics.com "; # Script rules for google analytics (1/3)
15
26
set $CSP "${CSP}https://ssl.google-analytics.com https://www.googletagmanager.com "; # Script rules for google analytics (2/3)
16
- set $CSP "${CSP}'sha512-e/cuSC5V9VDB1AUGqvPz2BwaJ2W83fduZ4RZjXHMtjQrLS0j06MAtFP//Iz9EL55MSm7SNBtyFYlDkmxdif/jg=='";
27
+ set $CSP "${CSP}'sha512-e/cuSC5V9VDB1AUGqvPz2BwaJ2W83fduZ4RZjXHMtjQrLS0j06MAtFP//Iz9EL55MSm7SNBtyFYlDkmxdif/jg=='; ";
17
28
# Script rules for google analytics (3/3)
18
29
# > From our inline script in index.html
19
- set $CSP "${CSP}https://cdn.channel.io;"; # Script rules for channel
20
30
21
31
add_header Content-Security-Policy $CSP always;
22
32
add_header X-Content-Type-Options nosniff;
23
33
add_header X-Frame-Options DENY;
24
34
add_header X-XSS-Protection "1; mode=block";
35
+ add_header Strict-Transport-Security "max-age=31536000";
36
+ add_header Referrer-Policy "origin";
25
37
26
38
root /usr/share/nginx/newara;
27
39
try_files $uri $uri/ /index.html;
0 commit comments