I have Apache httpd (2.2.22) configured as reverse proxy.
There is a situation in which I need to take my web server (the receiver of the proxied requests) offline for a few milliseconds. During this time the web server should not receive any requests but I also don't want to reject any requests.
What I'd like to do is to somehow get httpd to delay all requests for that period of time. In steps:
- tell httpd to delay all requests until further notice
- stop web server
- start web server
- continue request forwarding from httpd
A fixed delay would also do the trick but since I cannot foresee the actual amount of time the web server will be offline (other than that it will be less than one second), a dynamical approach would be better suited.
I've looked at how mod_proxy or mod_balancer could help me but I didn't find an obvious solution.
I'll be happy about any pointers you can give me.
It looks like a static approach is sufficient. Some helpful resources:
- httpd ProxyPass
- httpd ProxyTimeout
- ProxyPass with mod_rewrite (no need to use ProxyPass explicitly; no need to use ProxyPassInterpolateEnv)
- See also this post for a discussion on httpd returning 503 immediately (proxy and balancer).
We will be deploying systemd to our servers. systemd will solve my problem because it can retain requests on sockets that are closed on one end. This means that when I stop the backend server for a short period of time, all the requests will be queued until I start it again and connect to the socket. That's what I call elegant :)