Display maintenance page for all users except specific IP addresses during site renewal
Overview
This tutorial outlines how to utilize KurocoEdge to display a maintenance page for all accesses except those accessing from specific IP addresses during a site renewal process. The restriction will be limited to pages under /products/
, and the maintenance page will be displayed according to the maintenance start time and removed at the end of the maintenance period.
What you'll learn
In this tutorial, you will learn how to configure KurocoEdge to display a maintenance page for all accesses except those accessing from specific IP addresses by following these steps:
Prerequisites
This tutorial assumes you have completed the IP address restriction setup and understand how to configure access restrictions based on IP addresses.
Create a deployment with access restrictions
First, create a deployment with access restrictions enabled.
Clone an existing deployment
Click [KurocoEdge]->[Deployment list].
Select an existing deployment.
Click on [Clone] in the top right corner.
Restrict access to specific pages
By default(.*
), the entire site is subject to access restrictions.
In this tutorial, we will restrict access to pages under /products/
as an example.
In the cloned deployment, click on the access restriction rule in the rule list,and enter /products/.*
in the "URL path pattern" field.
This configuration ensures that the maintenance page will only be displayed for pages under /products/
directory.
Configure access restriction rules
We will set up rules for IP address restrictions using a whitelist.
Click on the [Request] tab and set the rules as follows.
Conditions / Variables
Field | Settings |
---|---|
Field settings | IP address |
IP address pattern | Allowed IP addresses |
Execution
Field | Settings |
---|---|
Field settings | Synthetic response |
HTTP status | 503 Service Unavailable |
Body | Include the phrase This website is currently under maintenance. in the body |
Directive Flag
Enable "Invert conditions result".
Once you have configured the page restrictions and confirmed the rules, click the [Update] button.
If the rules work correctly during the preview, proceed to configure the scheduled deployment activation.
Set the date and time for enabling access restrictions
You can automatically activate a deployment at a specified time by setting the scheduled publish date. This will apply the IP address restriction rules you configured at the maintenance start time.
Click the [Edit] button at the top of the edit page of the created deployment.
Set the maintenance start date and time as the scheduled publish date and click the [Update] button.
This completes the configuration of deployment "Version 5" with access restrictions enabled.
Create a deployment without access restrictions
Next, create a deployment without access restrictions.
Clone an existing deployment
Click [KurocoEdge]->[Deployment list].
Select the deployment "Version 5" you created earlier.
Click [Clone] in the upper right corner of the page.
Remove the rules
The deployment cloned from Version 5 contains IP address restriction rules. In the list of rules, check the checkbox for the IP address restriction rule and click [Delete].
Verify that the IP address restriction has been removed in the preview, and if there are no issues, proceed to configure the scheduled release.
Set the date and time to remove access restrictions
You can automatically activate the deployment at a specified time by setting the scheduled publish date. This will apply the rule that does not have IP address restrictions at the maintenance end time.
Click the [Edit] button at the top of the edit page for the created deployment.
Set the maintenance end date and time as the scheduled publish date and click [Update].
This completes the configuration of deployment "Version 6" without access restrictions.
Finally, verify the scheduled publish dates set on the deployment list page to confirm and complete the process.
Summary
With this configuration, when the maintenance start time arrives, deployment Version 5 will be activated, enforcing access restrictions and displaying the maintenance page under the /products/
directory. Similarly, when the maintenance end time is reached, deployment 'Version 6' without any access restrictions will be activated, lifting the maintenance page display.
Support
If you have any other questions, please contact us or check out Our Discord Community.