upstream test_backend {
server test1.com;
server test2.com;
}
location / {
proxy_set_header Host $host;
proxy_pass http://test_backend ;
}
这里的 $host 是请求客户端的 Host,代理过去也是客户端请求过来的 Host,不是我想要的;
如果配置成 $proxy_host,我测试发现代理过去的 Host 设置成 test_backend,也不是我想要的;
求教:
我想要的代理过去的 Host 是 upstream 中配置的 test1.com 或者 test2.com ,根据最终访问哪个域名自动设置;