Skip to main content

Displaying Sorry Page When Server is Heavy or Down

info

Estimated Time: 5 minutes

Overview

This tutorial explains how to display a sorry page using KurocoEdge when the server is heavy or down.

Prerequisites

This tutorial assumes that you have completed the following tasks described in the Beginner's Guide:

What You'll Learn

You will learn how to configure the display of a sorry page when the server is heavy or down using the following steps:

Create a Rule

Image from Gyazo

Select the draft deployment. Image from Gyazo

Click on [Clone] in the top right corner. Image from Gyazo

As the default backend, set your own site's URL which you added in Changing the Display of Your Website. Image from Gyazo

Click on [Add] in the rule list section. Image from Gyazo

Click on the Response tab. Image from Gyazo

Click on [Add Action]. Image from Gyazo

Condition / Variable

Click [Add Item] in "Condition / Variable" and configure as follows:

ItemConfiguration
Field settingsHTTP Status
HTTP Response Code Pattern504
tip

The HTTP Status pattern is a Regex. So while 504 will of course work as intended, it is also possible to input 5.. (or 5.* to test for any 500-599 code, to allow creation of a single rule covering many errors at once.

Image from Gyazo

Execution

Click [Add Item] in "Execution" and configure as follows:

ItemConfiguration
Field settingsSynthetic Response
HTTP Status503 Service Unavailable
BodyEnter the content of the error page in HTML format.
In this tutorial, we have changed the default "sample" part to <p>We apologize for the temporary error that occurred on the page you tried to access.</p><p>For more information, please contact example@test.com.</p>
HeaderNo editing required

Image from Gyazo

tip

If you already have a prepared error page and want to redirect to it, configure as follows: If you already have an error page prepared and you want to redirect to it, you can set the item configuration to the Redirect URL and configure it with a 302 Temporary Redirect and the URL of the redirect destination.

Image from Gyazo

Verification of Operation

When the rule is applied, the following display will appear. The status code is also set to 503.

Image from Gyazo

info

The above screenshot is taken to verify the operation, creating a similar process for 404.

caution

KurocoEdge rules are applied only when the response with the configured condition (HTTP response code 504) is returned from the backend server. If KurocoEdge cannot connect at all due to a problem with the backend server, the error page HTML configured in the Edge Settings will be displayed.

With the above configuration, when a 504 error occurs, the page specified in the "Action" section will be displayed.


Support

If you have any other questions, please contact us or check out Our Discord Community.