host header can be preserved via the
preserve_host_header setting or customized via three mutually exclusive options:
preserve_host_headerwill, when enabled, this option will pass the host header from the incoming request to the proxied host, instead of the destination hostname. It's an optional parameter of type
boolthat defaults to
host_rewrite, which will rewrite the host to a new literal value.
host_rewrite_header, which will rewrite the host to match an incoming header value.
host_path_regex_rewrite_substitution, which will rewrite the host according to a regex matching the path. For example with the following config:
Would rewrite the host header to
example.comgiven the path
The 2nd, 3rd and 4th options correspond to the Envoy route action host related options, which can be found here.