Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
2  
O_o And what's the problem? –  poige Apr 26 '12 at 6:14
add comment

3 Answers

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
add comment

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.

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.