Serve error pages using Apache HTTP Server

I use Tomcat to host my web application and apache http server on top of it using a mod proxy for load balancing.

When my application throws a 404 or 500 error, I want to serve error pages via the Apache http server, not the tomcat server. This is because I serve all my static content via apache and do not want it to be part of the war. Is there any way to do this?

+3
source share
1 answer

Specify the "ErrorDocument" directive in the virtualhost section of your apache configurator:

ErrorDocument 404 /path/to/my404page.html
ErrorDocument 500 /path/to/my500page.html

, mod proxy, ProxyErrorOverride, apache .

+2

Source: https://habr.com/ru/post/1762647/


All Articles