Ambassador Edge Stack can route to target services based on HTTP headers with the
regex_headers specifications. Multiple mappings with different annotations can be applied to construct more complex routing rules.
headers attribute is a dictionary of
value pairs. Ambassador Edge Stack will only allow requests that match the specified
value pairs to reach the target service.
will allow requests to /backend/ to succeed only if the x-quote-mode header has the value backend and the x-random-header has the value
You can also set the
value of a regex header to
".*" to test for the existence of a header.
will send requests that contain the x-quote-mode header to the quote-mode target, while routing all other requests to the quote-regular target.
The following mapping will route mobile requests from Android and iPhones to a mobile service: