Apache httpd workers retry

Posted by David Newcomb on Server Fault See other posts from Server Fault or by David Newcomb
Published on 2012-08-03T14:41:02Z Indexed on 2013/07/01 16:23 UTC
Read the original article Hit count: 274

I have an Apache httpd web server running mod_proxy and mod_proxy_balancer. The whole of /somedir is sent to 2 worker machines which service the requests using the round robin scheduler. Each worker machine is running IIS but I don't think that is important.

I can demonstrate the load balancer working by repeatedly requesting a single page which contains the IP address of the machine and can see that it switches from one to the other in a predictable round robin fashion.

If I switch off one of the IIS servers and start requesting the same page then each page only contains the IP address of the machine that is up. However, if I start IIS and don't run my IIS application then /somedir returns 500 (as it should).

I've added 500 to the failonstatus (Apache 2.4) so when it hits the error Apache places the worker machine into error state. Apache still returns the proxy error to the client though. How can I make Apache catch the proxy failure and retry using a different worker in the same way that a connection failure does.

Update

There is almost the same question asked in StackOverflow so joining them together.

http://stackoverflow.com/questions/11083707/httpd-mod-proxy-balancer-failover-failonstatus-transperant-switching

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-proxy