httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sheng Qiang Xu <>
Subject [users@httpd] How to customize error pages for only 502 and 503 and ignore other errors in Apache http server?
Date Mon, 02 Jul 2012 10:47:11 GMT


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

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


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?

Best Regards
View raw message