Skip to content

Commit 3f40db7

Browse files
committed
update rewrite client IP doc
1 parent 8deacae commit 3f40db7

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

site/content/how-to/data-plane-configuration.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ as arguments and add `/bin/sh` as the command. The deployment manifest should lo
160160

161161
## Configure PROXY protocol and RewriteClientIP settings
162162

163-
When the request is passed through multiple proxies or load balancers, the client IP is set to the IP address of the server that last handled the request. To preserve the original client IP address, you can configure `RewriteClientIP` settings in the `NginxProxy` resource. `RewriteClientIP` has the fields: _mode_, _trustedAddresses_ and _setIPRecursively_.
163+
When a request is passed through multiple proxies or load balancers, the client IP is set to the IP address of the server that last handled the request. To preserve the original client IP address, you can configure `RewriteClientIP` settings in the `NginxProxy` resource. `RewriteClientIP` has the fields: _mode_, _trustedAddresses_ and _setIPRecursively_.
164164

165165
**Mode** determines how the original client IP is passed through multiple proxies and the way the load balancer is set to receive it. It can have two values:
166166

@@ -173,7 +173,7 @@ The choice of mode depends on how the load balancer fronting NGINX Gateway Fabri
173173

174174
**SetIPRecursively** is a boolean field used to enable recursive search when selecting the client's address from a multi-value header. It is applicable in cases where we have a multi-value header containing client IPs to select from, i.e., when using `XForwardedFor` mode.
175175

176-
The following command creates an `NginxProxy` resource with `RewriteClientIP` settings that set the mode to XForwardedFor, enables recursive search for finding the client IP and sets a CIDR, IPAddress and Hostname in the list of trusted addresses to find the original client IP address.
176+
The following command creates an `NginxProxy` resource with `RewriteClientIP` settings that set the mode to ProxyProtocol and sets a CIDR in the list of trusted addresses to find the original client IP address.
177177

178178
```yaml
179179
kubectl apply -f - <<EOF
@@ -184,18 +184,13 @@ metadata:
184184
spec:
185185
config:
186186
rewriteClientIP:
187-
mode: XForwardedFor
188-
setIPRecursively: true
187+
mode: ProxyProtocol
189188
trustedAddresses:
190189
- type: CIDR
191-
value: ":1/28"
192-
- type: IPAddress
193-
value: "192.68.74.28"
194-
- type: Hostname
195-
value: "cafe.com"
190+
value "76.89.90.11/24"
196191
EOF
197192
```
198193

199-
For more information, see the `NginxProxy spec` in the [API reference]({{< relref "reference/api.md" >}}).
194+
For the full configuration API, see the `NginxProxy spec` in the [API reference]({{< relref "reference/api.md" >}}).
200195

201-
{{< note >}} When sending curl requests to a server expecting proxy information, use the flag `--harproxy-protocol` to avoid broken header errors. {{< /note >}}
196+
{{< note >}} When sending curl requests to a server expecting proxy information, use the flag `--haproxy-protocol` to avoid broken header errors. {{< /note >}}

0 commit comments

Comments
 (0)