Apache Reverse Proxy – Handling Error Pages When Proxied Server is Down

apache-2.2reverse-proxy

I am using Apache2 as a reverse proxy for tomcat, my configuration being something like:

ProxyRequests Off

ProxyPass        / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

My question is: can I configure Apache to show up a courtesy page (an "under construction" HTML static page) whenever Tomcat is down?

Best Answer

You can use the Apache ErrorDocument directive to do this. You should use a URL to point to your ErrorDocument otherwise if you use a filesystem reference you will get an additional 503 whilst trying to find it.

ErrorDocument 503 http://somehost.tld/errors/503.html
Related Topic