nginx精准反向代理

1,完全反向代理,将请求10.130.111.110服务器的请求全部转发到10.130.111.111服务器

location / {
proxy_pass http://10.130.111.111
}

 2,仅仅转发部分请求 将请求10.130.111.110服务器的/sub/static段的都转发到10.130.111.111/sub/static,其他段请求不转发

location /sub/static {
    proxy_pass http://10.130.111.111/sub/static
}
原文地址:https://www.cnblogs.com/aaronthon/p/11911030.html