| 
 
 
 | 
| Keep Server Online 
 If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
 
 or
 
 
   
 A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
 
 Thank You! Steffen
 
 Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |  | 
 | 
| | 
| | 
|  Topic: Custom error page apache with mod_proxy |  |  
| Author |  |  
| sanderbhg 
 
 
 Joined: 29 Sep 2021
 Posts: 1
 Location: Netherlands
 
 | 
|  Posted: Wed 29 Sep '21 13:35    Post subject: Custom error page apache with mod_proxy |   |  
| 
 |  
| I'm trying to setup a custom error page (reverse proxy is apache) 
 Service Unavailable
 
 The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
 
 **Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.**
 
 But the error page isn't loaded if I stop my tomcat server for example (503 error)
 
 And I receive the message above not my .HTML message
 
 my config looks like this:
 
 <VirtualHost *:443>
 ServerAdmin XXX
 ServerName  XXX
 
 
 # Possible values: debug, info, notice, warn, error, crit, alert, emerg.
 LogLevel warn
 ErrorLog XXX
 CustomLog XXX
 DocumentRoot /var/www/html/
 ErrorDocument 503 /503.html
 
 <Directory />
 AllowOverride None
 Require all granted
 </Directory>
 
 ProxyPreserveHost On
 <Location />
 AddDefaultCharset Off
 Require all granted
 ProxyPass ajp://XXX:XXX/ disablereuse=on
 </Location>
 
 If I changed the line ErrorDocument to foo instead of /503.html I see foo so it looks like the .HTML isn't loaded by the config? Is there someone who can help me with it?
 |  |  
| Back to top |  |  
| tangent Moderator
 
 
 Joined: 16 Aug 2020
 Posts: 397
 Location: UK
 
 | 
|  Posted: Mon 04 Oct '21 19:59    Post subject: |   |  
| 
 |  
| Sorry, I've only just spotted this post, and no one else has replied. 
 Believe you need to add the ProxyErrorOverride directive as detailed here - https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyerroroverride
 
  	  | Code: |  	  | ProxyErrorOverride On
 
 | 
 This will catch 400-5xx errors returned from your proxied server, and use the corresponding ErrorDocument(s) you've defined.
 |  |  
| Back to top |  |  
 
 | 
 |  | 
 |  |