@
zjqzxc 你的意思是
location /web1 {
proxy_pass http://192.168.1.1:9000; ### <-----------------------------
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /web2 {
proxy_pass http://192.168.1.2:9001; ###<--------------------------------------------
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
你的意思是这样吗?
访问 http://222.222.222.222/web1 就反代到 1:9000 http://222.222.222.222/web2 就 http://222.222.222.222/web2
我就是想要这种效果