开发者

Serve Error Pages Using Apache HTTP Server

I am using Tomcat for hosting my web application and apache http server on top of it using mod proxy for load balancing.

When my application throws a 404 or 500 error, I want to serve the error pages through apache http server rather than tomcat server. This is because I am serving all of my static content through apache and don't want it as part of war. Is there a way to 开发者_如何学运维do that?


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

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

Additionally, since you're using mod proxy, you may you may wish to enable ProxyErrorOverride to let apache generate custom error documents for proxied content.

Also check out the documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜