Issue description
APISIX supports rewriting of Host header while talking to the upstream nodes, either with the proxy-rewrite plugin or with "pass_host" and "upstream_host" attributes in Upstream configuration. However, they both rewrite host for the Upstream, not nodes - so for example if I have an upstream with nodes:
"nodes": {
"host-1.com:80": 1,
"host-2.com:443": 1
},
I can't set Host to "host-1.com" when the first node is picked by the balancer, and set Host to "host-2.com" when the second is picked. I have tried ngx.req.set_header() or set the upstream_host variable in balancer phase directly and they don't seem to work. Is it a constraint by nginx modules / openresty?
Environment
- apisix version (cmd:
apisix version): 2.5
- OS (cmd:
uname -a): Ubuntu 18.04
- OpenResty / Nginx version (cmd:
nginx -V or openresty -V): 1.19.3.1
- etcd version, if have (cmd: run
curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
- apisix-dashboard version, if have:
- luarocks version, if the issue is about installation (cmd:
luarocks --version):
Issue description
APISIX supports rewriting of Host header while talking to the upstream nodes, either with the proxy-rewrite plugin or with "pass_host" and "upstream_host" attributes in Upstream configuration. However, they both rewrite host for the Upstream, not nodes - so for example if I have an upstream with nodes:
I can't set Host to "host-1.com" when the first node is picked by the balancer, and set Host to "host-2.com" when the second is picked. I have tried ngx.req.set_header() or set the upstream_host variable in balancer phase directly and they don't seem to work. Is it a constraint by nginx modules / openresty?
Environment
apisix version): 2.5uname -a): Ubuntu 18.04nginx -Voropenresty -V): 1.19.3.1curl http://127.0.0.1:9090/v1/server_infoto get the info from server-info API):luarocks --version):