技术解析
现有服务器有两台: a.https://172.16.100.143:8443/t1 a.https://172.16.100.143:8443/g2
b.https://172.16.100.143:8443/t1 b.https://172.16.100.143:8443/g2
upstream t {
server 172.16.100.143:8443 weight=1;
server 172.16.100.144:8443 weight=2;
location ~ ^/t1(/?)(.*){
proxy_pass https://t
proxy_read_timeout 30;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
root html;
index index.html index.htm;
client_max_body_size 20m;
}
location ~ ^/g2(/?)(.*){
proxy_pass https://t;
proxy_read_timeout 30;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;国外服务器
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
root html;
index index.html index.htm;
client_max_body_size 20m;
}
如今效果似乎只代理到了 8443,而后面的目录没有代理到,求解