logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.


Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Custom error page apache with mod_proxy
Author
sanderbhg



Joined: 29 Sep 2021
Posts: 1
Location: Netherlands

PostPosted: Wed 29 Sep '21 13:35    Post subject: Custom error page apache with mod_proxy Reply with quote

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



Joined: 16 Aug 2020
Posts: 131
Location: UK

PostPosted: Mon 04 Oct '21 19:59    Post subject: Reply with quote

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


Reply to topic   Topic: Custom error page apache with mod_proxy View previous topic :: View next topic
Post new topic   Forum Index -> Apache