Documentation defect
Caddy automatically sets XFF, XFP and XFH headers, as long as the requesting proxy IP is seen as trusted. You can do that by adding proxy's CIDR intrusted_proxies global directive.
Since it is already enforced here and set to strict with a way to configure it via .env, these header_up setters should be removed from all reverse_proxy directives as they're pretty much redundant and Caddy will still strip this header if it comes from a CIDR it does not trust anyway. Caddy default behavior also grabs {client_ip} for X-Forwarded-For header.
Caddy is pretty similar to Traefik in this case!
See: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#defaults and https://caddy.community/t/caddy-reverse-proxy-x-forwarded-for-headers/26682/2
2 comments
Comment by Hampus
Comment by @MrRubberDucky