how to configure varnish to drop a connection instead of sending 503?

Peter Jacobs Peter.Jacobs at kuleuven.be
Mon Aug 26 15:16:12 CEST 2013


We have a machine with apache webserver and the apache loadbalancing module, in front of two backend machines running the same web application.
The apache loadbalancing module has very basic functionality and only drops a backend service if it doesn't respond within a certain time. This used to work fine:  if the backend service on one machine broke down, all connections would switch to the other machine

I have put Varnish on the two backend machines (it cannot be installed on the machine with apache). This helps with performance, but the loadbalancing part doesn't work anymore: if a backend service doesn't respond, varnish will return a "503 backend service not available" . The apache loadbalancer will happily accept it as a valid response and keep serving it to the client, instead of taking it out of the loadbalancer.

Is there a way to make Varnish just drop the connection if the backend is down, instead of sending a 503? This will help us until we upgrade to a better loadbalancer that can handle status codes.

Kind regards,
Peter Jacobs




More information about the varnish-misc mailing list