Nginx如何处理手机端和PC端跳转不同页面,nginx跳转
Nginx如何处理手机端和PC端跳转不同页面,nginx跳转
如果是手机端和pc端需要跳转不同的页面, 则需要在nginx.conf中的location / {}中加入如下代码:
if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') {
rewrite ^.+ http://127.0.0.1:8080/mobile/$uri;
}
其中mobile为手机端的路径标识, 可以自定义修改.
评论暂时关闭