nginx代理 proxy_pass
一 、代理后location不会被包含
location /master {
proxy_pass http://127.0.0.1:81/api/master;
}
请求地址:
http://localhost/master/search
代理后的地址:
http://127.0.0.1:81/api/master/search
二、代理后location会被包含
location /master {
proxy_pass http://127.0.0.1:81;
}
请求地址:
http://localhost/master/search
代理后的地址:
http://127.0.0.1:81/master/search
三、代理后location会被包含
location /master/ {
proxy_pass http://127.0.0.1:81;
}
请求地址:
http://localhost/master/search
代理后的地址:
http://127.0.0.1:81/master/search
四、代理后location不会被包含
location /master/ {
proxy_pass http://127.0.0.1:81/;
}
请求地址:
http://localhost/master/search
代理后的地址:
http://127.0.0.1:81/search