domain
Last updated
Was this helpful?
Last updated
Was this helpful?
Each domain
controls requests for a specific host:port. This permits different handling of requests to domains like localhost:8080
or catalog:8080
if desired. If uniform handling is required, wildcards are understood to apply to all domains. A domain set to match *:8080
will match both of the above domains.
NOTEThe domain port should, in most cases, match the port
of the exposed on the proxy. If they do not match, users will need to supply HOST:
header keywords to all requests to match the virtual domain.
Virtual host:port matching and redirecting
GZIP of requests
CORS
Setting custom headers for downstream requests
SSL Config for incoming requests
NOTE Do not set an ssl_config on any domain object whose service you want to use SPIFFE/SPIRE. If a domain ssl_config
is set, it will override the secret set on the corresponding listener and the mesh configuration will be wrong.
The domain
object has an optional ssl_config
field, which can be used to set up TLS and specify it's configuration. The Domain SSL Config Object appears as follows:
The sni
field for a domain
accepts a list of strings and configures the Envoy Listener to detect the requested Server Name Indication.
To specify a minimum and maximum TLS protocol version, set the protocols
field to one of the following: "TLSv1_0"
, "TLSv1_1"
, "TLSv1_2"
, "TLSv1_3"
. If one protocol is specified, it will be set as both the minimum and maximum protocol versions in Envoy. If more than one protocol version is specified in the list, the lowest will set the minimum TLS protocol version and the highest will set the maximum TLS protocol version. If this field is left empty, Envoy will choose the default TLS version.
The cipher_filter
field takes a colon :
delimited string to populate the cipher_suites
cipher list in envoy for TLS.
redirects
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
domain_key
A unique key used to identify this particular domain configuration. This key is used in proxy
, listener
, and route
objects.
zone_key
The zone in which this object will live. It will only be able to be referenced by objects or sent to Sidecars that live in the same zone.
name
This field can be set to a wildcard (*
) which will match against all hostnames.
port
E.g. port: 8080
and name: *
will setup a virtual domain matching any request made to port 8080 regardless of the host.
ssl_config
redirects
gzip_enabled
DEPRECATION: This field has been deprecated and will be removed in the next major version release.
This field has no effect.
cors_config
aliases
An array of additional hostnames that should be matched in this domain. E.g. name: "www.greymatter.io"
with aliases: ["greymatter.io", "localhost"]
force_https
custom_headers
An array of header key, value pairs to set on all requests that pass through this domain.
E.g.
checksum
An API calculated checksum. Can be used to verify that the API contains the expected object before performing a write.
The Domain SSL Configuration is used to populate a for the Envoy Listener.
This field can be used to configure redirect routes for the domain. See for details.
The name of this virtual domain, e.g. localhost
, www.greymatter.io
, or catalog.svc.local
. Only requests coming in to the named host will be matched and handled by attached . Is used in conjunction with the field.
Set the specific port of the virtual host to match. Is used in conjunction with the field.
for this cluster. Setting the SSL Config at the domain
level set this same config on all that are directly linked to this domain.
Array of URL
A to attach to this domain.
If true
, listeners attached to this domain will only accept HTTPS connections. In this case, one of the or fields should be set. If false
, attached listeners will only accept plaintext HTTP connections.