Mobile app version of vmapp.org
Login or Join
Smith883

: Apache proxypass directive does not recover quickly I am using this "simple" apache ProxyPass directive. <VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://0.0.0.0:3000/

@Smith883

Posted in: #Apache #Proxy #ReverseProxy

I am using this "simple" apache ProxyPass directive.

<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / 0.0.0.0:3000/ ProxyPassReverse / 0.0.0.0:3000/ ServerName my.name.org
</VirtualHost>


This works well. If the internal server listening on port 3000 "goes down" temporarily, and I make a request to "my.name.org", a 503 is returned as expected. However, even if the internal server comes up, subsequent request to "my.name.org" result in a 503 for "some period of time" (whereas, if no initial request that generates a 503 occurs, no subsequent requests work as normal). Is there some value I can adjust to make it so that after bringing the internal server back up, apache will notice it and use it more quickly?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Smith883

1 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

When a connection to a back-end server generates and error (default is any 5xx code) Apache marks that connection as in an Error State. Apache will then not use that connection for a period of time controlled by the retry parameter to ProxyPass. This defaults to 60 seconds.

This means that unless you change it, once your back-end generates a 5xx return code, Apache will not send any more request to it for 60 seconds, but will immediately return a 503 to the client browser.

You can change this by setting the retry to a lower number. For example, to wait only 5 seconds before re-trying:

ProxyPass / 0.0.0.0:3000/ retry=5


Details of this options, and many others, are in the ProxyPass documentation here: httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme