I have an Apache 2.4 server on Windows Server 2008 R2 that I use as a reverse proxy. It has been working fine and serves about 15 virtual hosts. Whenever a host fails, I want to display a web page indicating that the server is down temporarily. I placed the custom error file in a folder in the htdocs folder called errors. I have the following directives in the httpd.conf file:
ErrorDocument 500 /errors/default.html ErrorDocument 502 /errors/default.html ErrorDocument 503 /errors/default.html ErrorDocument 504 /errors/default.html ErrorDocument 400 /errors/default.html ErrorDocument 404 /errors/default.html ErrorDocument 408 /errors/default.html <Directory "C:/Program Files/Apache Software Foundation/Apache2.4/htdocs/errors"> Order deny,allow Allow from all </Directory> I shut down one of the proxied servers to test the error page and I see the following:
Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.
If I use a text error message e.g "The server is currently off line" then I DO see that text displayed. If I reference an external web server to serve the page then I see the page served from that server. It is almost as if the Apache server is ONLY proxying requests and is unable to serve the local error pages.
I am guessing I need to add or change a virtual host entry to allow the Apache server to serve a local page (the error pages) but since the server is only referenced by IP in DNS I am not sure how to do that (it is using named hosts). I just assumed that the error pages would be properly served by Apache without additional configuration (beyond allowing the permissions on the folder with the error pages and referencing them in the ErrorDocument entries).
What did I miss? The setting up of custom error documents seemed simple but I can't serve them from the proxy itself.