You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sheng Qiang Xu <sq...@cn.ibm.com> on 2012/07/02 12:47:11 UTC

[users@httpd] How to customize error pages for only 502 and 503 and ignore other errors in Apache http server?


Hi,

I am using apache as proxy server and another application server (like
Smash) is behind apache. In apache side, I only want to customize error
pages for 502 and 503 error and still display the application server's
response if other errors appear.


What I do now is:


ProxyErrorOverride On
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/data/www/errors">
    AllowOverride None
    Options IncludesNoExec
    AddOutputFilter Includes html
    AddHandler type-map var
    Order allow,deny
    Allow from all
    LanguagePriority en es de fr
    ForceLanguagePriority Prefer Fallback
</Directory>

 ErrorDocument 502 /errors/HTTP_BAD_GATEWAY.html.var
 ErrorDocument 503 /errors/HTTP_SERVICE_UNAVAILABLE.html.var

</IfModule>
</IfModule>



This works for 502 and 503, but it also overrides 4XX and other 5XX errors
with apache's default pages, not as expected.


Is there a way to only override 502, 503 in Apache and ignore other errors?
thanks.



Best Regards
--------------------
Sean