1)proxy_pass末尾不带”/”
server {
listen 80;
server_name www.baidu.com;
location /hello/
{
proxy_pass http://server:8080;
}
}
2)proxy_pass末尾带”/”
server {
listen 80;
server_name www.baidu.com;
location /hello/
{
proxy_pass http://server:8080/;
}
}
访问:http://www.baidu.com/hello/world.jsp
配置1):代理到http://server:8080/hello/world.jsp
配置2):代理到http://server:8080/world.jsp