Cris
Cris

Reputation: 31

Make apache mod_proxy ProxyErrorOverride include original page contents with mod_include

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

Upvotes: 0

Views: 2098

Answers (1)

covener
covener

Reputation: 17896

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.

Upvotes: 1

Related Questions