Hello everyone, I am running the latest version of traefik in docker, according to the recommendations I did in my compose.yml:
ports:
- target: 80
published: 80
mode: host
- target: 443
published: 443
mode: host
- target: 8080
published: 8080
mode: host
I also use cloudflare proxy and in this case all headers arrive as needed, real client addresses are substituted.
But if I turn off the proxy, then instead of real client addresses I see the addresses of my docker network
Hostname: 29dcd0dc9ea4
IP: 127.0.0.1
IP: ::1
IP: 192.168.147.15
IP: fe80::6439:79ff:feab:2763
RemoteAddr: 192.168.147.14:43230
GET / HTTP/1.1
Host: deleted
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: deleted
Cache-Control: max-age=0
Cookie: deleted
Priority: u=0, i
Sec-Ch-Ua: "Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "macOS"
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 192.168.147.14
X-Forwarded-Host: deleted
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Forwarded-Server: 13372420a2d8
X-Real-Ip: 192.168.147.14
I tried all possible settings including
- "--entryPoints.web.forwardedHeaders.insecure=true"
- "--entryPoints.websecure.forwardedHeaders.insecure=true"
- "--entryPoints.websecure.proxyProtocol.insecure=true"
But I can't solve the problem. The whoami service gives the client's address correctly only when you come through the cloudflare proxy, but if you disable proxying or register a real address in the hosts, everything breaks. Where should I look? I need help