How to Block Countries from Accessing Your Site

How to use a Web Control to block certain countries from accessing your site.

It’s possible to use a Web Control to block countries from accessing your application. This is done by using the Country of origin is... condition for the Web Control.

Create the Web Control

Click Web Controls on the menu. Then, click the Add A Web Control button to go to the Edit Web Control panel.

Webscale Web Controls page in the control panel

Type the name of the new Web Control in the Name field. Choose a unique, descriptive name and description to help you identify this Web Control in the future.

Create the Condition

Click + Add condition to create the condition to apply to the new Web Control, which opens the Create Condition dialog. To proceed, click Select a Condition. In this case, select Country of origin is from the selection list.

Webscale Create Condition dialog in the control panel

Click on a country in the Available Countries list, then click the Add→ button to add it. To remove a country from the Selected Countries list, click the ←Remove button. Tip: Hold control (Windows) or command (macOS) when you click to select more than one country. Click Done after making your choices.

Webscale Create Condition dialog showing country selection

Create the Action

Click + Add action to create an action for the new Web Control, which opens the Create Action dialog. To proceed, click Select an Action. Choose Deny Request in this case. You can also choose the HTTP status code and Response Body if you like. Click Done after making your selection.

Webscale Create Action dialog in the control panel

Once you’ve made your selection, click Done to save the Web Control. Once back on the Web Controls list, click the checkbox for Enabled to enable the new Web Control, and then click Apply to apply the changes.

Webscale Web Controls - apply changes

When a request is made from a country you’ve added to this list, then that request is dropped. The Deny Request action is a final action, and you can only choose one final action for each Web Control you create. Final actions run last; the order of execution of other actions is unspecified and not necessarily in the order displayed.

Further Reading

Have questions not answered here? Please Contact Support to get more help.

Last modified April 21, 2020