[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] enforce 503 response using RewriteRule or Redirect due to temporary maintenance

The configuration directives "RewirteRule" and "Redirect" are having flags to send a FORBIDDEN or GONE response but I need something to send a 503 service_unavailable response to keep away traffic from my proxied backends during maintenance work.

The idea is to use a RewriteMap for this cause I could modify the mapfile to apply maintenance URLs without restarting the httpd server.


appl1  /errmsg/maintenance
appl2  /errmsg/gone

RewirteMap offline txt:conf/map-offline.conf
RewriteRule ^/([^/]*)(.*)$   ${offline:$1|%{REQUEST_URI}} [NC,PT]

Redirect gone "/errmsg/gone"
Redirect maintenance "/errmsg/maintenance"

Using this setup any request on /appl2/anywhere gets a 410 GONE response - nice
But something like this to get a 503 response is not available.

I only need to add some lines of code into mod_alias to get the maintenance response. No big deal.
But maybe someone here knows a setup working without extending the source code.


( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache2-users/msg02786.html on line 69
Call Stack
10.0001357608{main}( ).../msg02786.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache2-users/msg02786.html on line 69
Call Stack
10.0001357608{main}( ).../msg02786.html:0