Is haproxy adding X-Forwarded-For to the request it sends varnish? If so, just don't have varnish manipulate X-Forwarded-For and your app will use the header added by HAProxy.

David

On 6/5/12 9:04 PM, [email protected] wrote:
Hi guys

Originally we had haproxy in front and connecting to backend server

    haproxy ->  backend server

and applications and backend server see the real client ip fine without any 
issues

But we decided to try adding Varnish cache in between

    haproxy ->  varnish ->  backend server

Problem now is backend server and ips are seeing the client ip of the haproxy 
server and not real visitor client ips.

varnish has the appropriate forwarding of client ips,

    remove req.http.X-Forwarded-For;
    set req.http.X-Forwarded-For = client.ip;

and works if Varnish only in front of backends.

So what setting if any in haproxy would I need to add or check for, to get the 
proper client ip from haproxy through varnish into the backend ?

Using haproxy v1.3 here with Varnish 3.0.2.

thanks

---
posted at http://www.serverphorums.com
http://www.serverphorums.com/read.php?10,508289,508289#msg-508289


Reply via email to