如果是手機端和pc端需要跳轉不同的頁面, 則需要在nginx.conf中的location / {}中加入如下代碼:
if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') {
rewrite ^.+ http://127.0.0.1:8080/mobile/$uri;
}
其中mobile爲手機端的路徑標識, 可以自定義修改.
如果是手機端和pc端需要跳轉不同的頁面, 則需要在nginx.conf中的location / {}中加入如下代碼:
if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') {
rewrite ^.+ http://127.0.0.1:8080/mobile/$uri;
}
其中mobile爲手機端的路徑標識, 可以自定義修改.