nginx代理端口并且转发到其他地址

location /ms {
        rewrite    /ms/([^/]+)/([^/]+) /$1/$2 break;
        proxy_http_version 1.1;
        proxy_set_header Connection "keep-alive";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://127.0.0.1:9501;
    }

此代码意思是 www.xxxxx.com/ms/xxxx 请求时转发到9501端口并且转发到www.xxxxx.com/ms下

你可能感兴趣的:(nginx)