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)?$|^/blog/) | 4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex
plorer|safari|yandex-browser|maxthon)?$|^/blog/) |
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 { | 302 { |
303 rewrite ^(.*) https://downloads.adblockplus.org$1; | 303 rewrite ^(.*) https://downloads.adblockplus.org$1; |
304 } | 304 } |
305 | 305 |
306 # Locations still served by the legacy server | 306 # Locations still served by the legacy server |
307 | 307 |
308 location ~ ^(/blog|/releases|/development-builds|/atom|/rss|/category|/section|/
author|/file_download|/images|/textpattern)($|/) | 308 location ~ ^(/blog|/releases|/development-builds|/atom|/rss|/category|/section|/
author|/file_download|/images|/textpattern)($|/) |
309 { | 309 { |
310 try_files $uri @proxied; | 310 try_files $uri @proxied; |
311 } | 311 } |
312 location /submitEmail | |
313 { | |
314 # https://issues.adblockplus.org/ticket/3204 | |
315 access_log /var/log/nginx/email_submission data; | |
316 echo_read_request_body; | |
317 } | |
318 location /verifyEmail | 312 location /verifyEmail |
319 { | 313 { |
320 # Workaround for MS Outlook's behavior of re-encoding URLs; | 314 # Workaround for MS Outlook's behavior of re-encoding URLs; |
321 # see https://issues.adblockplus.org/ticket/3180 for more information | 315 # see https://issues.adblockplus.org/ticket/3180 for more information |
322 if ($arg_email ~ (.*)%2540(.*)) { | 316 if ($arg_email ~ (.*)%2540(.*)) { |
323 set $email_user $1; | 317 set $email_user $1; |
324 set $email_domain $2; | 318 set $email_domain $2; |
325 rewrite ^(.*)$ $1?email=$email_user%40$email_domain&signature=$arg_signature
&product=$arg_product&lang=$arg_lang? redirect; | 319 rewrite ^(.*)$ $1?email=$email_user%40$email_domain&signature=$arg_signature
&product=$arg_product&lang=$arg_lang? redirect; |
326 } | 320 } |
327 | 321 |
(...skipping 23 matching lines...) Expand all Loading... |
351 location /403.html | 345 location /403.html |
352 { | 346 { |
353 try_files $uri @proxied; | 347 try_files $uri @proxied; |
354 } | 348 } |
355 location @proxied | 349 location @proxied |
356 { | 350 { |
357 proxy_pass https://server16.adblockplus.org; | 351 proxy_pass https://server16.adblockplus.org; |
358 proxy_set_header Host adblockplus.org; | 352 proxy_set_header Host adblockplus.org; |
359 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 353 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
360 } | 354 } |
OLD | NEW |