Display an error page when the server is experiencing heavy load or encounters an iIssue
Estimated Time: 5 minutes
Overview
This tutorial explains how to use KurocoEdge to display an error page when the server is experiencing heavy load or encounters issues.
Prerequisites
This tutorial assumes that you have already completed the steps outlined in the following Beginner's Guide:
What You'll Learn
You will learn how to configure KurocoEdge to display an error page when the server is experiencing heavy load or the website is unavailable by following these steps:
Create a Rule
lClick [KurocoEdge] > [Deployment list] from the side menu.
Select an existing deployment.
Click [Clone] in the top right corner.
Set your site's URL, which you added in changing the display of your website tutorial, as the default backend.
Click [Add] in the rule list page.
Click the [Response] tab.
Click [Add Action].
Condition / Variable
Click [Add Field] in "Condition / Variable" and configure as follows:
Field | Settings |
---|---|
Field settings | HTTP Status |
HTTP Response Code Pattern | 504 |
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.
Execution
Click [Add Field] in "Execution" and configure as follows:
Field | Settings |
---|---|
Field settings | Synthetic Response |
HTTP Status | 503 Service Unavailable |
Body | Enter the content of the error page in HTML format. In this tutorial, replace the default "sample" text wuth the following: <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> |
Header | No changes needed |
If you already have an error page prepated and want to redirect users to it, set up a Redirect URL
field settings, select 302 Temporary Redirect
, and enter the URL to redirect the users to.
Verify the configuration
Once the rule is applied, the following page will be displayed.
The status code will also be set to 503 as configured.
In the above screenshot, a similar rule for HTTP status 404 was set up to verify the configuration.
KurocoEdge rules are only applied when the response from the backend server matches the configured condition (HTTP response code 504).
If KurocoEdge cannot connect to the backend server at all due to a server issues, the error page HTML configured in the Edge Settings will be displayed instead.
With this setup, when a 504 error occurs, the page specified in the "Execution" section will be displayed.
Support
If you have any other questions, please contact us or check out Our Discord Community.