-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: The HTTP routing host field cannot match the port #10531
Comments
could you describe your problem in the issue description? |
The HTTP routing host field does not recognize the port |
I just tested it and I realise that the radixtree library doesn't support |
I think you can optimize it, thank you |
@DokiDoki1103 Welcome to contribute PR to fix this |
Would it be possible for me to try it out? |
If you want to take this up comment here: api7/lua-resty-radixtree#138 I will assign it to you. |
@DokiDoki1103 Did you try to configure host=8.130.141.31 instead of host=8.130.141.31:7070? I don't think it's a good practice to add port matching in host because I feel it can lead to confusion and it's not necessary for most cases. If what you need is server port filter, a possible workaround way is like this: "uri": "/*", |
Ok, this does need to be modified in radixtree |
How should I configure it here when I need to use the ingress controller? |
like this?
|
If the host contains port, then it will match the host, otherwise it will not match. I think this design will be more suitable for you. |
Sorry, I may not have expressed myself clearly. The port appearing in This situation may occur especially when there is a load balancer before apisix. Intuitively, one may feel that the port in the routing configuration needs to match the host in the http request header. |
Thank you for your PR. Indeed, this will solve my current problem |
If I want to access the HTTP service on a certain port, then your method is more effective, but if I want to match the port through Host, your method is not supported |
Yes, thank you for your advice.I will take it |
Hey, I've finished changing it. Thanks again for your advice |
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? |
Defining the host port in the route as server_port matching is actually a simpler method. |
No, I don't think so.
|
@shreemaan-abhishek Do you think the host on port 80 needs special treatment? |
@theweakgod I agree with you. |
Current Behavior
req
resp
The text was updated successfully, but these errors were encountered: