1. Caddy version (caddy version):
v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=
2. How I run Caddy:
With docker behind an existing reverse-proxy / application gateway.
a. System environment:
docker
b. Command:
docker
d. My complete Caddyfile or JSON config:
:443
log {
output stdout
format json
level info
}
tls /var/run/server.crt /var/run/server.key
reverse_proxy backend:80 {
header_up X-Forwarded-For {header.X-Forwarded-For}
}
3. The problem I’m having:
I run caddy behind a reverse-proxy/ application gateway. How can I make caddy “trust” the existing X-Forwarded-For and pass it on the backend?
4. Error messages and/or full log output:
Backend doesn’t get the original X-Forwarded-For header but the one generated by caddy (which is wrong, as it contains the first proxy/ application gateway ip).
5. What I already tried:
I tried to pass on the existing X-Forwarded-For header from the first proxy. Instead of the syntax used in the copied Caddyfile I also tried with “{http.request.header.X-Forwarded-For}”
6. Links to relevant resources:
Unfortunately none
