HAProxy community

Haproxy for Squid - How keep original IP



I am use HaProxy on Debian8 Load Balancing for 2 Squid Proxy “No Transparent” port 3128 with Autentication OpenLdap.

All work fine.

But in the log file on Squid (access.log) only show IP of HAproxy but no the IP of Client.

I Try with opcion X-Client but no result.

My haproxy.cfg

listen SQUID
mode http
cookie SERVERID insert indirect nocache
balance roundrobin
option httpclose
option forwardfor header X-Client
option forwardfor
server squid1 check inter 2000 rise 2 fall 5
server squid2 check inter 2000 rise 2 fall 5

Thanks for your atention.

Sorry for y English.


Did you configure Squid accordingly?




Ok, i try in the afternon and show the result.

thanks for you questions.



Try put this line:

option forwardfor except

On defaults section of haproxy.cfg


Hello I Solve with:

acl haproxy src ip_of_haproxy
follow_x_forwarded_for allow haproxy

Ref: http://www.squid-cache.org/Doc/config/follow_x_forwarded_for/


thanks a lot for the link lukastribus, it really helped me. can i ask some questions if i would have some others later? thank you!


Sure just ask, there is no need to ask if you can ask :slight_smile: