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
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-07 22:03:16