Customize HTTP server error 503 when Tomcat is not available

Document ID : KB000046243
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

With Secure Proxy Server, when Tomcat is shutdown/ not contactable, HTTP server error 503 is returned to end user as Apache failed to forward requests to Tomcat.


OOTB error:
==========================================================================
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
==========================================================================

 

Question:

How to customize the error, indicative of Tomcat is not available?

 

Environment:

All SPS releases.

 

Answer:

To customize the error, update the ErrorDocument directive in <SPS>\httpd\conf\httpd.conf file.

The syntax of the ErrorDocument directive is:

ErrorDocument <3-digit-code> <action>

where the action will be treated as:

  1. A local URL to redirect to (if the action begins with a "/").
  2. An external URL to redirect to (if the action is a valid URL).
  3. Text to be displayed (if none of the above). The text must be wrapped in quotes (") if it consists of more than one word.

 

Additional Information:

https://httpd.apache.org/docs/2.4/custom-error.html

https://httpd.apache.org/docs/2.4/mod/core.html#errordocument