比如:
将http://domain.com/test/abc.html 代理到 http://127.0.0.1/abc.html
方法一:
在反向代理路径后面添加"/"
location /test {
proxy_pass http://127.0.0.1/;
}方法二:
使用rewrite
location /test {
rewrite /test/(.*) /$1 break;
proxy_pass http://127.0.0.1;
}原文地址:http://blog.51cto.com/4988084/2121621