Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Anyone experienced with configuring Squid to forward requests to HAproxy?
I use Squid as a proxy, with ACLs and other stuff, and I need to know if I can tell it to forward requests to HAproxy, which would act as a load balancer that is aware when one of the backends is down.

share|improve this question
O_o And what's the problem? – poige Apr 26 '12 at 6:14
How would you implement an source-IP ACL? All the connections would seem to come from haproxy. Or does Squid have the ability to look at a particular request header instead? (I'm considering doing similar things with a different load-balancer product). – Cameron Kerr Dec 17 '15 at 4:38
I guess the really dumb solution is to put another layer of Squid in front of Haproxy. Sorry but this is a really old topic, and whatever experience I had back then with Squid, has long been forgotten :) – w00t Dec 18 '15 at 1:50

If you are using squid for caching shouldn't you be using WCCP and a WCCP capable router instead ? That allows you to load balance connections and can detect when a node is offline.

share|improve this answer
I do not have access to any router. I can only implement linux-based solutions, that's why I need to find a way so that when a node has no internet access, the other working node is chosen by Squid. And I was thinking at HAproxy for this. – w00t Aug 12 '10 at 11:32

HAProxy can perform health checks using the "httpchk" option.

backend mybackend
    option httpchk HEAD /check.txt HTTP/1.0
    server server1 check
    server server2 check
    server server3 check

HAProxy will look for /check.txt on each target node, and take it out of the cluster automatically if it doesn't receive an HTTP 200 on that file.

share|improve this answer

It might be simpler to use Varnish which can reverse proxy, cache, and do http checks of available back ends. Your Squid/HAProxy solution would work, but can be hard to troubleshoot when tcp sessions are going through multiple daemons.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.