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 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 if ($http_user_agent ~ \bPresto/\d+) { | 29 if ($http_user_agent ~ \bPresto/\d+) { |
30 set $user_agent "opera"; | 30 set $user_agent "opera"; |
31 } | 31 } |
32 if ($http_user_agent ~ \bOPR/\d+) { | 32 if ($http_user_agent ~ \bOPR/\d+) { |
33 set $user_agent "opera"; | 33 set $user_agent "opera"; |
34 } | 34 } |
35 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) { | 35 if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) { |
36 set $user_agent "android"; | 36 set $user_agent "android"; |
37 } | 37 } |
| 38 if ($http_user_agent ~ \bMaxthon/\d+) { |
| 39 set $user_agent "maxthon"; |
| 40 } |
38 | 41 |
39 set $platform "firefox"; | 42 set $platform "firefox"; |
40 if ($user_agent) { | 43 if ($user_agent) { |
41 set $platform $user_agent; | 44 set $platform $user_agent; |
42 } | 45 } |
43 | 46 |
44 if ($arg_a ~ ^(view|show)?$) { | 47 if ($arg_a ~ ^(view|show)?$) { |
45 rewrite ^/(index\.html)?$ /$preferredLang/$platform redirect; | 48 rewrite ^/(index\.html)?$ /$preferredLang/$platform redirect; |
46 rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$platform redirect; | 49 rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$platform redirect; |
47 } | 50 } |
48 | 51 |
49 rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent; | 52 rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent; |
50 rewrite ^/anwiki/(.*) /$1 permanent; | 53 rewrite ^/anwiki/(.*) /$1 permanent; |
51 | 54 |
52 if (-f $request_filename) { | 55 if (-f $request_filename) { |
53 break; | 56 break; |
54 } | 57 } |
55 if (-d $request_filename) { | 58 if (-d $request_filename) { |
56 break; | 59 break; |
57 } | 60 } |
58 | 61 |
59 set $static_uri $uri; | 62 set $static_uri $uri; |
60 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer)
/?$) { | 63 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|
maxthon)/?$) { |
61 set $static_uri "/$1/"; | 64 set $static_uri "/$1/"; |
62 set $platform $3; | 65 set $platform $3; |
63 } | 66 } |
64 set $static ""; | 67 set $static ""; |
65 if (-f "$document_root/static$static_uri") { | 68 if (-f "$document_root/static$static_uri") { |
66 set $static "ok"; | 69 set $static "ok"; |
67 } | 70 } |
68 if (-f "$document_root/static$static_uri/index") { | 71 if (-f "$document_root/static$static_uri/index") { |
69 set $static "ok"; | 72 set $static "ok"; |
70 } | 73 } |
71 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; | 74 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; |
72 if ($static ~ ^ok!(view|show)?!$) { | 75 if ($static ~ ^ok!(view|show)?!$) { |
73 rewrite ^ /static$static_uri?platform=$platform&user_agent=$user_agent las
t; | 76 rewrite ^ /static$static_uri?platform=$platform&user_agent=$user_agent las
t; |
74 } | 77 } |
75 | 78 |
76 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer)/?$
/index.php?p=$1&platform=$3&user_agent=$user_agent last; | 79 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android|internet-explorer|max
thon)/?$ /index.php?p=$1&platform=$3&user_agent=$user_agent last; |
77 rewrite ^/(.*) /index.php?p=$1 last; | 80 rewrite ^/(.*) /index.php?p=$1 last; |
78 } | 81 } |
79 | 82 |
80 location /static/ { | 83 location /static/ { |
81 index index; | 84 index index; |
82 internal; | 85 internal; |
83 types { | 86 types { |
84 image/png png; | 87 image/png png; |
85 text/xml xml; | 88 text/xml xml; |
86 text/css css; | 89 text/css css; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 fastcgi_param GATEWAY_INTERFACE CGI/1.1; | 127 fastcgi_param GATEWAY_INTERFACE CGI/1.1; |
125 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | 128 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; |
126 | 129 |
127 fastcgi_param REMOTE_ADDR $remote_addr; | 130 fastcgi_param REMOTE_ADDR $remote_addr; |
128 fastcgi_param REMOTE_PORT $remote_port; | 131 fastcgi_param REMOTE_PORT $remote_port; |
129 fastcgi_param SERVER_ADDR $server_addr; | 132 fastcgi_param SERVER_ADDR $server_addr; |
130 fastcgi_param SERVER_PORT $server_port; | 133 fastcgi_param SERVER_PORT $server_port; |
131 fastcgi_param SERVER_NAME $server_name; | 134 fastcgi_param SERVER_NAME $server_name; |
132 } | 135 } |
133 } | 136 } |
OLD | NEW |