mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-07 13:22:43 +02:00
updated host rewrite docs (#1799)
* updated host rewrite docs * quick fix * fixed precommit
This commit is contained in:
parent
9423159174
commit
c39fdb51e8
2 changed files with 16 additions and 33 deletions
|
@ -1125,11 +1125,13 @@ A request to `https://from.example.com/admin` would be forwarded to `https://to.
|
||||||
- Optional
|
- Optional
|
||||||
- Example: `host_rewrite: "example.com"`
|
- Example: `host_rewrite: "example.com"`
|
||||||
|
|
||||||
The `host` header can be customized via 3 mutually exclusive options:
|
The `host` header can be preserved via the `preserve_host_header` setting or customized via 3 mutually exclusive options:
|
||||||
|
|
||||||
1. `host_rewrite` which will rewrite the host to a new literal value.
|
1. `preserve_host_header` 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 `bool` that defaults to `false`.
|
||||||
2. `host_rewrite_header` which will rewrite the host to match an incoming header value.
|
See [ProxyPreserveHost](http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost).
|
||||||
3. `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution` which will rewrite the host according to a regex matching the path. For example with the following config:
|
2. `host_rewrite` which will rewrite the host to a new literal value.
|
||||||
|
3. `host_rewrite_header` which will rewrite the host to match an incoming header value.
|
||||||
|
4. `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution` which will rewrite the host according to a regex matching the path. For example with the following config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
host_path_regex_rewrite_pattern: "^/(.+)/.+$"
|
host_path_regex_rewrite_pattern: "^/(.+)/.+$"
|
||||||
|
@ -1138,7 +1140,7 @@ The `host` header can be customized via 3 mutually exclusive options:
|
||||||
|
|
||||||
Would rewrite the host header to `example.com` given the path `/example.com/some/path`.
|
Would rewrite the host header to `example.com` given the path `/example.com/some/path`.
|
||||||
|
|
||||||
These options correspond to the envoy route action host related options, which can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-routeaction).
|
The 2nd, 3rd and 4th options correspond to the envoy route action host related options, which can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-routeaction).
|
||||||
|
|
||||||
|
|
||||||
### Public Access
|
### Public Access
|
||||||
|
@ -1201,17 +1203,6 @@ See the [envoy documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/
|
||||||
Policy timeout establishes the per-route timeout value. Cannot exceed global timeout values.
|
Policy timeout establishes the per-route timeout value. Cannot exceed global timeout values.
|
||||||
|
|
||||||
|
|
||||||
### Preserve Host Header
|
|
||||||
- `yaml`/`json` setting: `preserve_host_header`
|
|
||||||
- Type: `bool`
|
|
||||||
- Optional
|
|
||||||
- Default: `false`
|
|
||||||
|
|
||||||
When enabled, this option will pass the host header from the incoming request to the proxied host, instead of the destination hostname.
|
|
||||||
|
|
||||||
See [ProxyPreserveHost](http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost).
|
|
||||||
|
|
||||||
|
|
||||||
### Set Request Headers
|
### Set Request Headers
|
||||||
- Config File Key: `set_request_headers`
|
- Config File Key: `set_request_headers`
|
||||||
- Type: map of `strings` key value pairs
|
- Type: map of `strings` key value pairs
|
||||||
|
|
|
@ -1246,6 +1246,7 @@ settings:
|
||||||
"host_rewrite_header",
|
"host_rewrite_header",
|
||||||
"host_path_regex_rewrite_pattern",
|
"host_path_regex_rewrite_pattern",
|
||||||
"host_path_regex_rewrite_substitution",
|
"host_path_regex_rewrite_substitution",
|
||||||
|
"preserve_host_header",
|
||||||
]
|
]
|
||||||
attributes: |
|
attributes: |
|
||||||
- `yaml`/`json` settings: `host_rewrite`, `host_rewrite_header`, `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution`
|
- `yaml`/`json` settings: `host_rewrite`, `host_rewrite_header`, `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution`
|
||||||
|
@ -1253,11 +1254,13 @@ settings:
|
||||||
- Optional
|
- Optional
|
||||||
- Example: `host_rewrite: "example.com"`
|
- Example: `host_rewrite: "example.com"`
|
||||||
doc: |
|
doc: |
|
||||||
The `host` header can be customized via 3 mutually exclusive options:
|
The `host` header can be preserved via the `preserve_host_header` setting or customized via 3 mutually exclusive options:
|
||||||
|
|
||||||
1. `host_rewrite` which will rewrite the host to a new literal value.
|
1. `preserve_host_header` 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 `bool` that defaults to `false`.
|
||||||
2. `host_rewrite_header` which will rewrite the host to match an incoming header value.
|
See [ProxyPreserveHost](http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost).
|
||||||
3. `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution` which will rewrite the host according to a regex matching the path. For example with the following config:
|
2. `host_rewrite` which will rewrite the host to a new literal value.
|
||||||
|
3. `host_rewrite_header` which will rewrite the host to match an incoming header value.
|
||||||
|
4. `host_path_regex_rewrite_pattern`, `host_path_regex_rewrite_substitution` which will rewrite the host according to a regex matching the path. For example with the following config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
host_path_regex_rewrite_pattern: "^/(.+)/.+$"
|
host_path_regex_rewrite_pattern: "^/(.+)/.+$"
|
||||||
|
@ -1266,7 +1269,7 @@ settings:
|
||||||
|
|
||||||
Would rewrite the host header to `example.com` given the path `/example.com/some/path`.
|
Would rewrite the host header to `example.com` given the path `/example.com/some/path`.
|
||||||
|
|
||||||
These options correspond to the envoy route action host related options, which can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-routeaction).
|
The 2nd, 3rd and 4th options correspond to the envoy route action host related options, which can be found [here](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-routeaction).
|
||||||
- name: "Public Access"
|
- name: "Public Access"
|
||||||
keys: ["allow_public_unauthenticated_access"]
|
keys: ["allow_public_unauthenticated_access"]
|
||||||
attributes: |
|
attributes: |
|
||||||
|
@ -1327,17 +1330,6 @@ settings:
|
||||||
- Default: `30s`
|
- Default: `30s`
|
||||||
doc: |
|
doc: |
|
||||||
Policy timeout establishes the per-route timeout value. Cannot exceed global timeout values.
|
Policy timeout establishes the per-route timeout value. Cannot exceed global timeout values.
|
||||||
- name: "Preserve Host Header"
|
|
||||||
keys: ["preserve_host_header"]
|
|
||||||
attributes: |
|
|
||||||
- `yaml`/`json` setting: `preserve_host_header`
|
|
||||||
- Type: `bool`
|
|
||||||
- Optional
|
|
||||||
- Default: `false`
|
|
||||||
doc: |
|
|
||||||
When enabled, this option will pass the host header from the incoming request to the proxied host, instead of the destination hostname.
|
|
||||||
|
|
||||||
See [ProxyPreserveHost](http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost).
|
|
||||||
- name: "Set Request Headers"
|
- name: "Set Request Headers"
|
||||||
keys: ["set_request_headers"]
|
keys: ["set_request_headers"]
|
||||||
attributes: |
|
attributes: |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue