Apache proxy caching "service temporarily unavailable" response when target is down

StackOverflow https://stackoverflow.com/questions/18661999

  •  28-06-2022
  •  | 
  •  

문제

I have apache sitting in front of my node server. Node is running on certain port, I am using apache to proxy to that port and also have apache configured for https.

When I start apache and then start my node server everything runs great. If I bring down the node server and try to hit my service apache says 'Service Temporarily Unavailable'. This is expected as my node server is down.

However when I bring my server back up without touching apache and try to hit me service again apache still says 'Service Temporarily Unavailable'. Its like apache is not trying again. If I bounce apache all is well again.

Since I am running with forever there is a chance my server could be down for a few second if a fatal happens. I don't want to have to bounce apache if that happens.

Is there anyway to get apache to always try and not cache the fact that a Service it recently tried to hit was unavailable?

도움이 되었습니까?

해결책

You need to add retry=0 to ProxyPass directive. So it will be something like:

ProxyPass /example http://backend.example.com retry=0

Check some info here: http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top