Forwarded
Configures which proxies in front of tilegroxy are trusted to report the original client IP, host, protocol, port, and path prefix.
Description
A CDN, load balancer, or reverse proxy replaces the details of the original request with its own and passes the originals along in headers. Tilegroxy only reads those headers when the request arrives from an address listed in Trusted. Requests from anywhere else use their own connection details and any forwarding headers are ignored.
By default every private, loopback, and link-local address is trusted, which covers a proxy running on the same host or network as tilegroxy. A CDN or load balancer with a public address needs to be added. Setting Trusted replaces the default rather than adding to it, and an empty list trusts nothing.
The client IP is used for rate limiting, analytics, and every log. The host, protocol, port, and path prefix are used to build the URLs in TileJSON documents.
For the X-Forwarded-For header, the right-most address that isn’t itself a trusted proxy is used. Any other For header, such as CF-Connecting-IP or True-Client-IP, must hold a single address.
Never include addresses outside your own infrastructure in Trusted. Anyone sending requests from a trusted address can pick their own IP and get a fresh rate limit allowance on every request. If clients can reach tilegroxy directly from a private network, narrow Trusted to just your proxies.
|
Example
-
YAML
-
JSON
server:
forwarded:
trusted:
- 10.0.0.0/8
headers:
for: CF-Connecting-IP
{
"server": {
"forwarded": {
"trusted": [
"10.0.0.0/8"
],
"headers": {
"for": "CF-Connecting-IP"
}
}
}
}
Configuration
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
IP addresses or CIDR ranges of every CDN, load balancer, and reverse proxy in front of tilegroxy. In Kubernetes this is usually the pod CIDR of your ingress controller |
string[] |
No |
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8, fc00::/7, fe80::/10, ::1/128 |
|
The headers trusted proxies put the original request details in |
No |
See below |
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
The header holding the client IP |
string |
No |
X-Forwarded-For |
|
The header holding the host the client requested |
string |
No |
X-Forwarded-Host |
|
The header holding the protocol the client used, either |
string |
No |
X-Forwarded-Proto |
|
The header holding the port the client connected to, a number from 1 to 65535. Ignored when the host already includes a port |
string |
No |
X-Forwarded-Port |
|
The header holding the path the proxy serves tilegroxy under. Must start with |
string |
No |
X-Forwarded-Prefix |
| Configuration Parameter | Environment Variable |
|---|---|
|
|
|
|
|
|
|
|
|
|