File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
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+ unless region.empty?
12+ region = "-#{region}"
13+ end
14+
15+ return "#{bucket}.s3#{region}.amazonaws.com"
16+ end
17+ %>
18+
119daemon off;
220#Heroku dynos have at least 4 cores.
321worker_processes <%= ENV['NGINX_WORKERS'] || 4 %> ;
@@ -124,6 +142,7 @@ http {
124142 add_header X-Content-Type-Options "no-sniff";
125143 add_header X-Frame-Options "SAMEORIGIN";
126144 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'";
127146
128147 add_header Strict-Transport-Security "max-age=31536000" always;
129148 add_header Vary 'Accept, Accept-Encoding, Cookie';
You can’t perform that action at this time.
0 commit comments