Skip to main content

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]. Image from Gyazo

Select an existing deployment. Image from Gyazo

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

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. Image from Gyazo

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​

Image from Gyazo

FieldSettings
Field settingsIP address
IP address patternAllowed IP addresses

Execution​

Image from Gyazo

FieldSettings
Field settingsSynthetic response
HTTP status503 Service Unavailable
BodyInclude the phrase This website is currently under maintenance. in the body

Directive Flag​

Image from Gyazo

Enable "Invert conditions result".

Once you have configured the page restrictions and confirmed the rules, click the [Update] button. Image from Gyazo

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. Image from Gyazo

Set the maintenance start date and time as the scheduled publish date and click the [Update] button. Image from Gyazo

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]. Image from Gyazo

Select the deployment "Version 5" you created earlier. Image from Gyazo

Click [Clone] in the upper right corner of the page. Image from Gyazo

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]. Image from Gyazo

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. Image from Gyazo

Set the maintenance end date and time as the scheduled publish date and click [Update]. Image from Gyazo

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.

Image from Gyazo

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.