Routes match the URI portion of the incoming request and route traffic to different shared_rules. This allows requests to routes like /api/v1 and /api/v2 to end up at entirely different hosts if desired. The routes objects support matching, prefix rewriting, and redirection of requests.
When a match is found using the values configured in route_match, the value of the :path header on the request will be replaced with this value for forwarding.
redirects
This field can be used to configure redirect routes for the domain. See Redirect for details.
Fields:
name
the name of the redirect
from
regex value that the incoming request :path will be regex matched to
to
the new URL that an incoming request matching from will route to
if set to "$host", will redirect to the name of the domain
redirect_type
determines the response code of the redirect
must be one of: "permanent" (for a 301 code), "temporary" (for a 307 code)
header_constraints
a list of header constraint objects
each header constraint has the following fields:
name
the header key to be compared to the incoming requests headers
will be compared without case sensitivity
value
must be a valid regex
the value to be compared to the value of the incoming request header with matching name
case_sensitive
boolean indicating whether the value will be compared to the value of the header with matching name with case sensitivity
invert
boolean value
shared_rules_key
Indicates the key of the shared_rules object to use for specifying a default cluster to forward to.
This field may be omitted if rules are defined directly.
rules
A list of rules to specify various more complex route matching and forwarding specifications.
response_data
A collection of annotations that should be applied to responses when handling a request. Configuration
cohort_seed
This field has no effect.
retry_policy
A retry_policy that controls how this route will handle automatic retries to upstream clusters and govern timeouts.
high_priority
Defaults to false, which indicates this is normal traffic. If set to true, routes are considered high priority which allows different handling of the request.
filter_metadata
A map from string to metadata that can be used to provide virtual host-specific configurations for filters. See the per route filter configuration guide for info on setting this up.
request_headers_to_add
Specifies a set of headers that will be added to requests matching this route.
E.g.
request_headers_to_remove
Specifies a list of HTTP headers that should be removed from each request matching this route.
E.g.
response_headers_to_add
Specifies a set of headers that will be added to responses matching this route.
E.g.
response_headers_to_remove
Specifies a list of HTTP headers that should be removed from each response matching this route.
E.g.
checksum
An API calculated checksum. Can be used to verify that the API contains the expected object before performing a write.