Real IP from ELB

I'm implementing Traefik 2 as an ingress controller for k8s in AWS and am looking to log the real external address. I'm only seeing internal IPs in X-Real-Ip and X-Forwarded-For. I've enabled the proxy protocol for the ELB but still am unable to log the client IP.

1 Like

Related: How to forward request IP to service in Traefik v2?

TL;DR: Publish ports in host mode.

Hi, this solution is for Docker Swarm, not k8s.

I'm encountering the same issue and seeking for solutions :confused:

Hello @mindcruft,

If you are running k8s, the service you use to configure the ELB will determine what is required to preserve the source IP.

Please see https://kubernetes.io/docs/tutorials/services/source-ip/

Note that this configuration is outside of Traefik. If Traefik is presented the source IP, it will use it, and log it properly.

1 Like