nginx 反向代理的一个细节
server {
listen 80;
server_name www.a.com;
location /path/ {
proxy_pass http://localhost:8080;
}
}
#访问 http://www.a.com/path/index.html 实际访问的是 http://localhost:8080/path/index.html
server {
listen 80;
server_name www.a.com;
location /path/ {
proxy_pass http://localhost:8080/;
}
}
#访问 http://www.a.com/path/index.html 实际访问的是 http://localhost:8080/index.html
#区别只在一个/