Linux运维最佳实践pdf下载
if ($http_user_agent ~* "Android") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "iPhone") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "iPod") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "iPad") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "Windows Phone") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "Mobile") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "Nokia") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "SAMSUNG") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "HTC") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "BlackBerry") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "LG") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "SonyEricsson") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "MOT") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "Opera Mini") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "J2ME") {
rewrite . http://m.baidu.com/ break;
}
if ($http_user_agent ~* "mqqbrowser") {
rewrite . http://m.baidu.com/ break;
}
proxy_pass http://www.baidu.com/;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Connection Close;
}
转载请注明:谷谷点程序 » nginx判断手机的操作系统