I’ve configured an Amazon Elastic Load Balancing (ELB) in front of a HAProxy node but I’m having issues preserving the Client’s IP, the access logs have random IPs associated with my VPC CIDR Network.
When I access directly the HAProxy, the correct IP is visible but not when I pass through the ELB.
Config:
ELB:
Set “X-Forwarded-For header” to “Append” and enabled “Preserve host header”
HAProxy:
frontend fe_https
http-request del-header X-Forwarded-For
backend be_authelia
option forwardfor
check your HA Configuration:
In your HAProxy configuration (haproxy.cfg), ensure that you’re correctly handling the X-Forwarded-For header:
http-request del-header X-Forwarded-For
This line http-request del-header X-Forwarded-For is deleting the X-Forwarded-For header that HAProxy receives from ELB. This might be the cause of not getting the correct client IP.
2