Nginx移动重定向失败

Nginx移动重定向失败,nginx,Nginx,当我转到移动重定向工作,但当我转到一些其他网页,它失败,并服务于原始链接 location / { if ($http_user_agent ~* "(iPhone|iPod|android|blackberry)" ) { return 301 $scheme://$host/m$request_uri; } index index.php; } location /m/ {

当我转到移动重定向工作,但当我转到一些其他网页,它失败,并服务于原始链接

       location / {

        if ($http_user_agent ~* "(iPhone|iPod|android|blackberry)" ) {
            return 301 $scheme://$host/m$request_uri;
        }

       index index.php;

    }

    location /m/ {
        index index.php;

    }

你必须告诉nginx你的服务器名称的根在哪里,所以在移动检测之后,你必须告诉nginx桌面的根在哪里