File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ <%
2
+ def s3_host(env)
3
+ cdn = env['S3_CDN']
4
+ if cdn and !cdn.empty?
5
+ return cdn
6
+ end
7
+
8
+ region = env['S3_REGION']
9
+ bucket = env['S3_BUCKET']
10
+
11
+ if region and !region.empty?
12
+ region = "-#{region}"
13
+ end
14
+
15
+ return "#{bucket}.s3#{region}.amazonaws.com"
16
+ end
17
+ %>
18
+
1
19
daemon off;
2
20
#Heroku dynos have at least 4 cores.
3
21
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %> ;
@@ -121,9 +139,10 @@ http {
121
139
expires max;
122
140
}
123
141
124
- add_header X-Content-Type-Options "no-sniff ";
142
+ add_header X-Content-Type-Options "nosniff ";
125
143
add_header X-Frame-Options "SAMEORIGIN";
126
144
add_header X-XSS-Protection "1; mode=block";
145
+ add_header Content-Security-Policy "default-src 'self'; connect-src 'self' https://docs.rs https://<%= s3_host(ENV) %> ; script-src 'self' 'unsafe-eval' https://www.google.com; style-src 'self' https://www.google.com https://ajax.googleapis.com; img-src *; object-src 'none'";
127
146
128
147
add_header Strict-Transport-Security "max-age=31536000" always;
129
148
add_header Vary 'Accept, Accept-Encoding, Cookie';
You can’t perform that action at this time.
0 commit comments