Nginx根据PC端和手机端跳转不同的路径
http
{
...
server
{
listen 80;
server_name localhost;
location / {
root /opt/web/dist;
if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) {
#手机端就跳转手机端的部署路径
root /opt/mobile/dist;
}
index index.html index.htm;
}
}
}