Route to different Service based on header with same path #3331
pramodbabua
started this conversation in
General
Replies: 1 comment
-
No, the level of specificity required is on purpose - the more magic we make this sort of config, the easier it is to end up with weird edge cases that are even harder to understand. To put that another way, it's intended that every match specifies all the criteria it's matching by. In this case, you're matching on both path and header, so you need to include both. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the HTTPRoute resource, I wanted to achieve the below,
/api with header service=service1 should route to backend service 1
/api with header service=service2 should route to backed service 2
I was able to achieve it by writing HTTPRoute as below,
Is there a cleaner way to achieve this rather than rewriting the pathprefix for every match? Potentially looking at overriding root path to say '/api' instead of '/' for this httproute resource as a whole.
Beta Was this translation helpful? Give feedback.
All reactions