theweakgod commented on issue #10531:
URL: https://github.com/apache/apisix/issues/10531#issuecomment-1833914331

   > I think we should think more about what effect we want to achieve:
   > 
   > If http_host is example.com, server_port is 8000, and the host configured 
in route is example.com:8000, is it be expected to match? A more confusing 
example, an http request, if http_host is example.com, server_port is 8000, and 
the host configured in route is example.com:80, is the route be expected to 
match?
   
   No, I don't think so.
   1. When load balancing proxy requests, you can set whether to keep the 
original host. If the server_port is 8000 and the route is set to 
"www.foo.com", you can set the Host to www.foo.com through proxy_set_header. I 
don't think apisix needs to handle the situation that front load balancing can 
handle. I don't think it is necessary to consider both the original Host and 
the Host after being proxied. In the http route of apisix, you only need to 
consider the Host in the request header when making a request, not the ip and 
port of the tcp connection.
   
   2. If you really need to match www.foo.com:8000, then you can customize a 
request header in the load balancing to record the original host, and do not 
set Host $host through proxy_set_header. Set "www.foo.com:8000" in route to 
match www.foo.com:8000.
   
   3. I think it is unnecessary to deal with the special case of 
www.foo.com:80, because the port of www.foo.com is 80 by default, and there is 
no need to handle it specially.


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to