You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# HTTP header to use to determine the real client IP, if the Signer is behind a proxy (e.g. nginx)
189
189
# OPTIONAL. If missing, the client IP will be taken directly from the TCP connection.
190
190
# [signer.reverse_proxy]
191
-
# Unique: HTTP header name to use to determine the real client IP. Expected to appear only once in the request. Requests with multiple values of this header will be rejected.
192
-
# unique = "X-Real-IP"
193
-
# Rightmost: HTTP header name to use to determine the real client IP from a comma-separated list of IPs. Rightmost IP is the client IP. If the header appears multiple times, the last value will be used.
194
-
# rightmost = "X-Forwarded-For"
191
+
# Type of reverse proxy configuration. Supported values:
192
+
# - unique: use a single HTTP header value as the client IP.
193
+
# - rightmost: use the rightmost IP from a comma-separated list of IPs in the HTTP header.
194
+
# type = "unique"
195
+
# Unique: HTTP header name to use to determine the real client IP. If the header appears multiple times, the request will be rejected.
196
+
# header = "X-Real-IP"
197
+
# Rightmost: HTTP header name to use to determine the real client IP from a comma-separated list of IPs. If the header appears multiple times, the last value will be used.
198
+
# header = "X-Forwarded-For"
199
+
# Rightmost: number of trusted proxies in front of the Signer, whose IPs will be skipped when extracting the client IP from the rightmost side of the list. Must be greater than 0.
200
+
# trusted_count = 1
195
201
196
202
# [signer.tls_mode]
197
203
# How to use TLS for the Signer's HTTP server; two modes are supported:
Copy file name to clipboardExpand all lines: docs/docs/get_started/configuration.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -401,21 +401,26 @@ jwt_auth_fail_timeout_seconds = 300 # The time window in seconds
401
401
402
402
The rate limit is applied to the IP address of the client making the request. By default, the IP is extracted directly from the TCP connection. If you're running the Signer service behind a reverse proxy (e.g. Nginx), you can configure it to extract the IP from a custom HTTP header instead. There're two options:
403
403
404
-
-`unique`: The name of the HTTP header that contains the IP. This header is expected to appear only once in the request. This is common when using `X-Real-IP`, `True-Client-IP`, etc. If a request is received that has multiple values for this header, it will be considered invalid and rejected.
405
-
-`rightmost`: The name of the HTTP header that contains a comma-separated list of IPs. The rightmost IP in the list is used. If the header appears multiple times, the last occurrence is used. This is common when using `X-Forwarded-For`.
404
+
- unique: Provides an HTTP header that contains the IP. This header is expected to appear only once in the request. This is common when using `X-Real-IP`, `True-Client-IP`, etc. If a request has multiple values for this header, it will be considered invalid and rejected.
405
+
-`rightmost`: Provides an HTTP header that contains a comma-separated list of IPs. The nth rightmost IP in the list is used. If the header appears multiple times, the last occurrence is used. This is common when using `X-Forwarded-For`.
406
406
407
407
Examples:
408
408
409
409
```toml
410
410
[signer.reverse_proxy]
411
-
unique = "X-Real-IP"
411
+
type = "unique"
412
+
header = "X-Real-IP"
412
413
```
413
414
414
415
```toml
415
416
[signer.reverse_proxy]
416
-
rightmost = "X-Forwarded-For"
417
+
type = "rightmost"
418
+
header = "X-Forwarded-For"
419
+
trusted_count = 1
417
420
```
418
421
422
+
Note: `trusted_count` is the number of trusted proxies in front of the Signer service, but the last proxy won't add its address, so the number of skipped IPs is `trusted_count - 1`. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For#trusted_proxy_count) for more info.
423
+
419
424
## Custom module
420
425
421
426
We currently provide a test module that needs to be built locally. To build the module run:
0 commit comments