zhoujiexiong commented on issue #11421:
URL: https://github.com/apache/apisix/issues/11421#issuecomment-2265001262

   > @zhoujiexiong Thanks for your reply! I noticed that your previous replies 
all involve routes directly bound to a host. However, our practice has always 
been to use a service to bind the host. In certain situations, to distinguish 
requests, we pick a host from within the service to bind to a specific route.
   > 
   > 
![image](https://private-user-images.githubusercontent.com/9711651/354542525-e406213c-cb1d-460e-851b-fc87111ec1be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1OTA3OTksIm5iZiI6MTcyMjU5MDQ5OSwicGF0aCI6Ii85NzExNjUxLzM1NDU0MjUyNS1lNDA2MjEzYy1jYjFkLTQ2MGUtODUxYi1mYzg3MTExZWMxYmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDJUMDkyMTM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDViNjc3NzAwN2RmMjYyZGIwYmZmZTczZTM5ZTBkNzVjYTU0MGQ3YzlkNzRhMTgyZmZmNDU4ZGM5OTAwMGJkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.kl0y0tixq1yHag4XKFtVgpbCOHU9JHazQgH6zVrZQRw)
   > 
   > According to experience, more specific conditions in route should be 
matched first, but it'snt.
   > 
   > Our expectation is that a request to this host+URI should hit the route 
that's bound to the host, not a route that isn't bound to any host. 
Historically, the behavior of our gateway has been in line with this 
expectation. When a request is made to a specific host+URI, it prioritizes the 
route that's bound to that host.
   > 
   > The problem only started appearing recently. We haven't made any version 
updates in the meantime, which leaves us puzzled as to why this discrepancy has 
suddenly arisen.
   > 
   > Based on my past experience, a host bound on the service is considered a 
default setting. If a route binds to a host, then a request to that host should 
prioritize hitting that route.
   > 
   > I would greatly appreciate any insights or clarifications from the experts 
on this issue.
   
   @jagerzhang 
   In my reproduction test, `route_test1` is also ref. host by service.
   The logic of the test should be identical to the reproduction steps you 
provided.
   <img width="838" alt="image" 
src="https://github.com/user-attachments/assets/b1422285-f9ff-4668-b44a-1d200096a899";>
   
   BTW, about the `priority`
   If a route has `host[s]` field and ref. `service` that also has `host[s]` 
field, the directly `host[s]` of the route will take effect.
   Notice that it's in ONE route, but we are using TWO.
   


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