-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add how-to for configuring XFF handling
- Loading branch information
1 parent
9eb93a2
commit 39223ee
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
docs/modules/ROOT/pages/how-tos/ingress/xff-configuration.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
= Configuring X-Forwarded-For handling | ||
|
||
This how-to explains how to configure the ingress' handling of the forwarded headers (`Forwarded` and `X-Forwarded-For`) on a per-route basis. | ||
|
||
== Possible behaviours | ||
|
||
* *`append`*: By default, the ingress is configured to append the headers to any existing headers. If `Forwarded` and `X-Forwarded-For` headers are already present when the ingress receives a request, the existing values are preserved, and new values are appended by the ingress. | ||
* *`replace`*: If forwarded header handling is set to `replace`, any existing forwarded headers are discarded. Only the headers set by the ingress will be available. | ||
* *`never`*: If forwarded header handling is set to `never`, the ingress will never set these headers, and leave any existing headers untouched. | ||
* *`if-none`*: If forwarded header handling is set to `if-none`, the ingress will only set the headers if they're not already present. If any headers are present, they're left unchanged. | ||
|
||
== Annotating the route | ||
|
||
Forwarded header handling is configured by annotating the `Route` object. | ||
|
||
[source,console] | ||
---- | ||
oc annotate route my_route haproxy.router.openshift.io/set-forwarded-headers="replace" | ||
---- | ||
|
||
To change the forwarded header handling back to default, simply remove the annotation: | ||
|
||
[source,console] | ||
---- | ||
oc annotate route my_route haproxy.router.openshift.io/set-forwarded-headers- | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters