# PROXY headers

**Matching table** (endpoint `proxy_protocol` and the CrushMFT port it points at):

| Endpoint `proxy_protocol` | CrushMFT port |
|---|---|
| `none` (default) | neither `proxy_header` nor `proxy_header_v2`. CrushMFT sees the balancer's address |
| `v1` | `proxy_header` on, `proxy_header_v2` off |
| `v2` | `proxy_header_v2` on, `proxy_header` off |

- FTP passive ranges also need the global `proxy_protocol_ftp_pasv=true` in CrushMFT.
- On a `backend_tls` endpoint the header is sent before the TLS handshake, as CrushMFT expects.
- Health probes to the endpoint's own port send a PROXY header too (a v2 LOCAL header, or a v1 line naming the probe's own connection), so a PROXY-only port can be probed.
- **Inbound PROXY behind an upstream load balancer.** Set `proxy_protocol_in=true` on the listener and list the upstream balancers' addresses in `trusted_proxies` (required). Every connection must then start with a PROXY v1 or v2 header (within 3 seconds and 4096 bytes); sources outside `trusted_proxies` are reset. The client address from the header is used for rules, stickiness, caps, logs and the outbound header.
- On an `http` or `https` listener without inbound PROXY, `trusted_proxies` names the upstream proxies whose `X-Forwarded-For` is extended and whose forwarding headers are kept; everyone else's are removed.
- **SNI off.** Keep SNI off on every CrushMFT port that receives a PROXY header, HTTPS and FTPS ports included (also when a `tcp` listener passes HTTPS or implicit FTPS through): with SNI on, CrushMFT appears to read the header as a TLS record.
- **Firewall the backends.** CrushMFT accepts a PROXY header from any source on a PROXY-enabled port, so make those ports reachable only from the balancer ([Hardening](Hardening.md)).
