Make apache mod_proxy ProxyErrorOverride include original page contents with mod_include

烂漫一生 提交于 2019-12-12 01:42:43

问题


I'm using apache mod_proxy to forward certain requests to an IIS server and also use ProxyErrorOverride to provide a corporate style on the error pages.

However I would like to include the original servers error message in custom error pages to provide some additional information when debugging 500-errors. Right now the entire error page is replaced. According to http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyerroroverride this could be possible with mod_include, but I couldn't find any more details on this issue. Can someone help me or point me to the solution?

My apache config:

    ProxyPreserveHost On
    ProxyPass /errors !
    ProxyPass / http://192.168.1.15:80/
    ProxyPassReverse / http://192.168.1.15:80/
    ProxyErrorOverride On
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html

回答1:


Unfortunately it's not possible to combine the backend error response with the canned error response. The backend response is thrown away when it is to be replaced with the local error document.

The manual is desribing something quite different. When you #include a proxied resource, the SSI processor would just see the backend error response and incorporate it directly. With ProxyErrrOverride ON, it generates an SSI error.



来源:https://stackoverflow.com/questions/30487574/make-apache-mod-proxy-proxyerroroverride-include-original-page-contents-with-mod

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!