docs: document preserve_host_header with policy routes to static ip (#1024)

Fixes #1012
This commit is contained in:
Cuong Manh Le 2020-06-30 14:26:08 +07:00 committed by GitHub
parent e27ee4dd32
commit 65150f2c3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -87,6 +87,9 @@ type Policy struct {
// PreserveHostHeader disables host header rewriting. // PreserveHostHeader disables host header rewriting.
// //
// This option only takes affect if the destination is a DNS name. If the destination is an IP address,
// use SetRequestHeaders to explicitly set the "Host" header.
//
// https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header // https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header
PreserveHostHeader bool `mapstructure:"preserve_host_header" yaml:"preserve_host_header,omitempty"` PreserveHostHeader bool `mapstructure:"preserve_host_header" yaml:"preserve_host_header,omitempty"`

View file

@ -58,6 +58,14 @@ In `0.9.0`:
option httpchk GET /ping HTTP/1.1\r\nHost:pomerium option httpchk GET /ping HTTP/1.1\r\nHost:pomerium
``` ```
### preserve_host_header option
With this release, Pomerium uses an embedded envoy proxy instead hand-written one. Thus, we defer the preserve host header
functionality to [envoy's auto_host_rewrite](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-routeaction-auto-host-rewrite),
which does not affect if the policy routes to a static IP.
To preserve 0.8.x behavior, you can use the `set_request_headers` option to explicitly set the Host header.
# Since 0.8.0 # Since 0.8.0
## Breaking ## Breaking