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 15 matching lines...) Expand all Loading... |
26 set $user_agent "chrome"; | 26 set $user_agent "chrome"; |
27 } | 27 } |
28 if ($http_user_agent ~ \bMSIE\ \d+) | 28 if ($http_user_agent ~ \bMSIE\ \d+) |
29 { | 29 { |
30 set $user_agent "internet-explorer"; | 30 set $user_agent "internet-explorer"; |
31 } | 31 } |
32 if ($http_user_agent ~ \bTrident/\d+) | 32 if ($http_user_agent ~ \bTrident/\d+) |
33 { | 33 { |
34 set $user_agent "internet-explorer"; | 34 set $user_agent "internet-explorer"; |
35 } | 35 } |
36 if ($http_user_agent ~ \bEdge/\d+) | |
37 { | |
38 set $user_agent "internet-explorer"; | |
39 } | |
40 if ($http_user_agent ~ \bPresto/\d+) | 36 if ($http_user_agent ~ \bPresto/\d+) |
41 { | 37 { |
42 set $user_agent "opera"; | 38 set $user_agent "opera"; |
43 } | 39 } |
44 if ($http_user_agent ~ \bOPR/\d+) | 40 if ($http_user_agent ~ \bOPR/\d+) |
45 { | 41 { |
46 set $user_agent "opera"; | 42 set $user_agent "opera"; |
47 } | 43 } |
48 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) | 44 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) |
49 { | 45 { |
50 set $user_agent "android"; | 46 set $user_agent "android"; |
51 } | 47 } |
| 48 if ($http_user_agent ~ \bEdge/\d+) |
| 49 { |
| 50 set $user_agent "edge"; |
| 51 } |
52 if ($http_user_agent ~ \bYaBrowser/\d+) | 52 if ($http_user_agent ~ \bYaBrowser/\d+) |
53 { | 53 { |
54 set $user_agent "yandex-browser"; | 54 set $user_agent "yandex-browser"; |
55 } | 55 } |
56 if ($http_user_agent ~ \bMaxthon/\d+) | 56 if ($http_user_agent ~ \bMaxthon/\d+) |
57 { | 57 { |
58 set $user_agent "maxthon"; | 58 set $user_agent "maxthon"; |
59 } | 59 } |
60 if ($http_user_agent ~ \b(iPad|iPhone|iPod)\b) | 60 if ($http_user_agent ~ \b(iPad|iPhone|iPod)\b) |
61 { | 61 { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 location /403.html | 279 location /403.html |
280 { | 280 { |
281 try_files $uri @proxied; | 281 try_files $uri @proxied; |
282 } | 282 } |
283 location @proxied | 283 location @proxied |
284 { | 284 { |
285 proxy_pass https://server16.adblockplus.org; | 285 proxy_pass https://server16.adblockplus.org; |
286 proxy_set_header Host adblockplus.org; | 286 proxy_set_header Host adblockplus.org; |
287 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 287 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
288 } | 288 } |
OLD | NEW |