if ( $http_user_agent ~ "((MIDP)|(WAP)|(UP.Browser)|(Smar
Tphone) | (Obigo) | (Mobile) | (AU. Browser) | (WxD. MMS) | (Wxdb.browser) | (CLDC) | (U
P.link) | (KM. Browser) | (UCWEB) | (Semc-browser) | (Mini) | (Symbian) | (Palm) | (Nokia) | (Panasonic) | (MOT)
| (SonyEricsson) | (NEC) | (Alcatel) | (Ericsson) | (BENQ) | (BenQ) | (amoisonic) | (Amoi) | (Capitel) | (PHILIPS
)| (SAMSUNG) | (Lenovo) | (Mitsu) | (Motorola) | (Sharp) | (Wapper) | (LG) | (EG900) | (C
ECT) | (Compal) | (Kejian) | (Bird) | (BIRD) | (g900/v1.0) | (Arima) | (CTL) | (TDG) | (Da
Xian) | (Daxian) | (Dbtel) | (eastcom) | (eastcom) | (Pantech) | (Dopod) | (Haier) | (HAIER) | (Konka) | (Kejian) |
(LENOVO) | (Soutec) | (Soutec) | (SAGEM) | (SEC) | (SED) | (Emol) | (INNO55) | (ZTE) | (IP
Hone) | (Android) | (Windows CE) | (Wget) | (Java) | (Curl) | (Opera)) {
Rewrite ^/(. *) $ http://wap.xxx.cn/$1;
rewrite ^/$ http://wap.xxx.cn; } 这段是用于配置手机访问web站点自动跳转到手机页面。 这个代码需要配置再web站点的service{} 区域里,位置再集群跳转区块前做判断。 location ~ \.(do)$ { proxy_pass http://upstream; proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_redirect off; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } location ~* ^/(upload)/ { root /mnt/www; expires 1d; }
Need to automatically jump to the corresponding phone station page when the phone accesses the PC station page