| OLD | NEW |
| 1 server { | 1 server { |
| 2 root /var/www/adblockplus.org/httpdocs; | 2 root /var/www/adblockplus.org/httpdocs; |
| 3 | 3 |
| 4 location / { | 4 location / { |
| 5 index index.php index index.html; | 5 index index.php index index.html; |
| 6 | 6 |
| 7 if ($arg_a = "view") { | 7 if ($arg_a = "view") { |
| 8 rewrite ^(.*) $1? permanent; | 8 rewrite ^(.*) $1? permanent; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 if ($http_user_agent ~ \bPresto/\d+) { | 32 if ($http_user_agent ~ \bPresto/\d+) { |
| 33 set $user_agent "opera"; | 33 set $user_agent "opera"; |
| 34 } | 34 } |
| 35 if ($http_user_agent ~ \bOPR/\d+) { | 35 if ($http_user_agent ~ \bOPR/\d+) { |
| 36 set $user_agent "opera"; | 36 set $user_agent "opera"; |
| 37 } | 37 } |
| 38 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) { | 38 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) { |
| 39 set $user_agent "android"; | 39 set $user_agent "android"; |
| 40 } | 40 } |
| 41 if ($http_user_agent ~ \bYaBrowser/\d+) { |
| 42 set $user_agent "yandex-browser"; |
| 43 } |
| 41 if ($http_user_agent ~ \bMaxthon/\d+) { | 44 if ($http_user_agent ~ \bMaxthon/\d+) { |
| 42 set $user_agent "maxthon"; | 45 set $user_agent "maxthon"; |
| 43 } | 46 } |
| 44 | 47 |
| 45 set $platform "firefox"; | 48 set $platform "firefox"; |
| 46 if ($user_agent) { | 49 if ($user_agent) { |
| 47 set $platform $user_agent; | 50 set $platform $user_agent; |
| 48 } | 51 } |
| 49 | 52 |
| 50 if ($arg_a ~ ^(view|show)?$) { | 53 if ($arg_a ~ ^(view|show)?$) { |
| 51 rewrite ^/(index\.html)?$ /$preferredLang/$platform redirect; | 54 rewrite ^/(index\.html)?$ /$preferredLang/$platform redirect; |
| 52 rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$platform redirect; | 55 rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$platform redirect; |
| 53 } | 56 } |
| 54 | 57 |
| 55 rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent; | 58 rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent; |
| 56 rewrite ^/anwiki/(.*) /$1 permanent; | 59 rewrite ^/anwiki/(.*) /$1 permanent; |
| 57 | 60 |
| 58 if (-f $request_filename) { | 61 if (-f $request_filename) { |
| 59 break; | 62 break; |
| 60 } | 63 } |
| 61 if (-d $request_filename) { | 64 if (-d $request_filename) { |
| 62 break; | 65 break; |
| 63 } | 66 } |
| 64 | 67 |
| 65 set $static_uri $uri; | 68 set $static_uri $uri; |
| 66 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|
safari|maxthon)/?$) { | 69 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|
safari|yandex-browser|maxthon)/?$) { |
| 67 set $static_uri "/$1/"; | 70 set $static_uri "/$1/"; |
| 68 set $platform $3; | 71 set $platform $3; |
| 69 } | 72 } |
| 70 set $static ""; | 73 set $static ""; |
| 71 if (-f "$document_root/static$static_uri") { | 74 if (-f "$document_root/static$static_uri") { |
| 72 set $static "ok"; | 75 set $static "ok"; |
| 73 } | 76 } |
| 74 if (-f "$document_root/static$static_uri/index") { | 77 if (-f "$document_root/static$static_uri/index") { |
| 75 set $static "ok"; | 78 set $static "ok"; |
| 76 } | 79 } |
| 77 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; | 80 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; |
| 78 if ($static ~ ^ok!(view|show)?!$) { | 81 if ($static ~ ^ok!(view|show)?!$) { |
| 79 rewrite ^ /static$static_uri?platform=$platform&user_agent=$user_agent las
t; | 82 rewrite ^ /static$static_uri?platform=$platform&user_agent=$user_agent las
t; |
| 80 } | 83 } |
| 81 | 84 |
| 82 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|saf
ari|maxthon)/?$ /index.php?p=$1&platform=$3&user_agent=$user_agent last; | 85 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|saf
ari|yandex-browser|maxthon)/?$ /index.php?p=$1&platform=$3&user_agent=$user_agen
t last; |
| 83 rewrite ^/(.*) /index.php?p=$1 last; | 86 rewrite ^/(.*) /index.php?p=$1 last; |
| 84 } | 87 } |
| 85 | 88 |
| 86 location /static/ { | 89 location /static/ { |
| 87 index index; | 90 index index; |
| 88 internal; | 91 internal; |
| 89 types { | 92 types { |
| 90 image/png png; | 93 image/png png; |
| 91 text/xml xml; | 94 text/xml xml; |
| 92 text/css css; | 95 text/css css; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 fastcgi_param GATEWAY_INTERFACE CGI/1.1; | 133 fastcgi_param GATEWAY_INTERFACE CGI/1.1; |
| 131 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | 134 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; |
| 132 | 135 |
| 133 fastcgi_param REMOTE_ADDR $remote_addr; | 136 fastcgi_param REMOTE_ADDR $remote_addr; |
| 134 fastcgi_param REMOTE_PORT $remote_port; | 137 fastcgi_param REMOTE_PORT $remote_port; |
| 135 fastcgi_param SERVER_ADDR $server_addr; | 138 fastcgi_param SERVER_ADDR $server_addr; |
| 136 fastcgi_param SERVER_PORT $server_port; | 139 fastcgi_param SERVER_PORT $server_port; |
| 137 fastcgi_param SERVER_NAME $server_name; | 140 fastcgi_param SERVER_NAME $server_name; |
| 138 } | 141 } |
| 139 } | 142 } |
| OLD | NEW |