Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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
share|improve this answer
That is correct, since I am proxying all the pages starting from "/", so there won't be any web server actually servicing an error page of the type "/var/www/html/error/gonefishing.html" –  Overflow May 13 '11 at 11:29

Apache will throw a 503 "Service unavailable" error when it can't connect to Tomcat. You could just create a "nice" 503 error page.

ErrorDocument 503 /var/www/html/error/gonefishing.html
share|improve this answer

Pardon my ignorance.But can't you put ProxyPass /var/www/html/error ! to ignore just that folder and so serve up the page from that folder ?

share|improve this answer
that does not seem correct, check the ProxyPass Directive httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass –  krisdigitx Mar 14 at 17:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.