Opensource Kong API Gateway can route by header? #8020
Answered
by
liyangau
storehubdeploy
asked this question in
Help
-
we need a new request that one domain can route to different back service by header diffrent key. is any plugins or just need wirte by myself. Is anyone has the example? |
Beta Was this translation helpful? Give feedback.
Answered by
liyangau
Nov 3, 2021
Replies: 1 comment 1 reply
-
Kong route object supports it by default. Consider below as an example services:
- name: first-svc
url: https://httpbin.org/anything
routes:
- name: first-route
hosts: ["example.com"]
headers:
test-header:
- first
paths:
- /demo
- name: second-svc
url: https://mockbin.org/request
routes:
- name: second-route
hosts: ["example.com"]
headers:
test-header:
- second
paths:
- /demo Request -> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
guanlan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kong route object supports it by default.
Consider below as an example
Request ->
http://example.com/demo -H "test-header:first"
-> httpbinRequest ->
http://example.com/demo -H "test-header:second"
-> mockbin