Trying to create a maintenance mode for a apache proxy I've followed this apache wiki page:
https://cwiki.apache.org/confluence/display/HTTPD/MaintenancePage
I defined all this in a VirtualHost
# Redirect all requests to a 503 return code when in maintenance mode
ErrorDocument 503 /maintenance/index.html
RewriteEngine on
RewriteCond /var/www/maintenance/ALL -f [OR]
RewriteCond /var/www/maintenance/%{SERVER_NAME} -f
RewriteCond %{REQUEST_URI} !=/maintenance/index.html
RewriteRule ^ - [R=503,L]
the maintenance mode functions well. If I create a file named '/var/www/maintenance/ALL'
I am using this same VirtualHost to ProxyPass all requests (/) to a Remote Host
ProxyPass / https://RemoteHost:1234/
ProxyPassReverse / https://RemoteHost:1234/
The problem is, the ProxyPass is executed also if the RewriteRule is executed, what results in an document not found error, because the 503 error document is beeing looked for at the remote host, not at the apache proxy server
How do I prevent the ProxyPass directive from beeing executed, if "Maintenance Mode" is activated and the 503 error page should be shown?