Gary-Airwallex opened a new issue #4197:
URL: https://github.com/apache/apisix/issues/4197


   ### 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`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to