OLD | NEW |
1 # XSS and clickjacking prevention headers | 1 # XSS and clickjacking prevention headers |
2 | 2 |
3 set $csp_frame ""; | 3 set $csp_frame ""; |
4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex
plorer|safari|yandex-browser|maxthon)?$) | 4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex
plorer|safari|yandex-browser|maxthon)?$) |
5 { | 5 { |
6 set $csp_frame "; frame-src www.youtube-nocookie.com;"; | 6 set $csp_frame "; frame-src www.youtube-nocookie.com;"; |
7 } | 7 } |
8 add_header Content-Security-Policy "default-src 'self'; img-src * data:; style-s
rc 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' $csp_
frame"; | 8 add_header Content-Security-Policy "default-src 'self'; img-src * data:; style-s
rc 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' $csp_
frame"; |
9 add_header X-Frame-Options "sameorigin"; | 9 add_header X-Frame-Options "sameorigin"; |
10 | 10 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 location ~ ^(/blog|/releases|/development-builds|/atom|/rss|/category|/section|/
author|/file_download|/images|/textpattern|/default-static|/_override-static)($|
/) | 243 location ~ ^(/blog|/releases|/development-builds|/atom|/rss|/category|/section|/
author|/file_download|/images|/textpattern|/default-static|/_override-static)($|
/) |
244 { | 244 { |
245 try_files $uri @proxied; | 245 try_files $uri @proxied; |
246 } | 246 } |
247 location /submitEmail | 247 location /submitEmail |
248 { | 248 { |
249 try_files $uri @proxied; | 249 try_files $uri @proxied; |
250 } | 250 } |
251 location /verifyEmail | 251 location /verifyEmail |
252 { | 252 { |
| 253 # Workaround for MS Outlook's behavior of re-encoding URLs; |
| 254 # see https://issues.adblockplus.org/ticket/3180 for more information |
| 255 if ($arg_email ~ (.*)%2540(.*)) { |
| 256 set $email_user $1; |
| 257 set $email_domain $2; |
| 258 rewrite ^(.*)$ $1?email=$email_user%40$email_domain&signature=$arg_signature
&product=$arg_product&lang=$arg_lang? redirect; |
| 259 } |
| 260 |
253 try_files $uri @proxied; | 261 try_files $uri @proxied; |
254 } | 262 } |
255 location /forum | 263 location /forum |
256 { | 264 { |
257 try_files $uri @proxied; | 265 try_files $uri @proxied; |
258 } | 266 } |
259 location /subscriptions.xml | 267 location /subscriptions.xml |
260 { | 268 { |
261 try_files $uri @proxied; | 269 try_files $uri @proxied; |
262 } | 270 } |
(...skipping 16 matching lines...) Expand all Loading... |
279 location /403.html | 287 location /403.html |
280 { | 288 { |
281 try_files $uri @proxied; | 289 try_files $uri @proxied; |
282 } | 290 } |
283 location @proxied | 291 location @proxied |
284 { | 292 { |
285 proxy_pass https://server16.adblockplus.org; | 293 proxy_pass https://server16.adblockplus.org; |
286 proxy_set_header Host adblockplus.org; | 294 proxy_set_header Host adblockplus.org; |
287 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 295 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
288 } | 296 } |
OLD | NEW |