-1

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.

w00t
  • 1,164
  • 3
  • 19
  • 35
  • 3
    O_o And what's the problem? – poige Apr 26 '12 at 06: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 04:38
  • 1
    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 01:50

3 Answers3

0

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.

topdog
  • 3,520
  • 17
  • 13
  • 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
0

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

backend mybackend
    option httpchk HEAD /check.txt HTTP/1.0
    server server1 123.123.123.101:80 check
    server server2 123.123.123.102:80 check
    server server3 123.123.123.103:80 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.

Matt Beckman
  • 1,502
  • 18
  • 33
0

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.

kashani
  • 3,922
  • 19
  • 18