Home Others How to block specific countries in your website from Cloudflare

How to block specific countries in your website from Cloudflare

by Sangam Adhikari

Cloudflare is a Content Delivery Network (CDN) that provides your website with additional security and performance advantages.

It basically improves the security of your website by preventing spammers and bad bots from accessing it using DNS firewall. It also acts as a performance booster by loading javascript and CSS from its enormous CDN network. It also includes extra functionality, such as the ability to add apps that are immediately loaded from Cloudflare, such as support widgets, Google Analytics, and other relevant apps.

Cloudflare’s functionality is not limited to this; it can also be used to do a range of tasks. You may set up a firewall for your site, write rules for it, monitor traffic, allocate caching, and write rules for it.

If you aren’t still using CDN, We recommend you to move to Content Delivery Network (CDN).

We’ll learn about Cloudflare’s firewall feature in this article, which allows you to restrict a specific IP, Cookie session, or Country from accessing your website.

How to block countries from Cloudflare?

You can block a specific country to access your site in Cloudflare by navigating to the firewall settings and defining a firewall rule for the country you want to restrict.

For the process, we’re writing a step-by-step procedure:

Let’s start with the dashboard of the website you’d want to visit. Something like this should be seen.

Click on the firewall, and go to the firewall rules section where we will be adding the country to be blacklisted from our site.

Click on the firewall, then go to the firewall rules area to add the country to be blocked from our website.

Now, You’ll be prompt to add various details.

First, You need to provide a name to your rule.

Second, you must decide what you would like to block. As previously said, you will be given numerous options such as IP, Cookies, SSL, URL, and Country. We’re going to pick a country in this article.

Third, you have the option of selecting the action you wish to take; for example, you might require users from a specified country to complete the captcha before they can access your site. You can set up a JS challenger, and of course, you can also block users.

After completing the steps below, you can deploy your settings and start blocking users from the specified country.
When a person visits your site, they will get the Cloudflare Error 1020 notice like this:

What is Error 1020 in website?

When you notice an “Error 1020” on a website, it indicates that the website’s administrator has blocked you from accessing their site due to your country, IP address, or other restrictions.

How to Fix Error 1020 in website?

It’s not up to you to fix the “Error 1020” on the website; this error indicates that the site’s administrator has blocked your access to the site. You can get around the restriction by switching to a different country VPN, changing your IP address, or clearing the cache of the website you’re having difficulties visiting.

The most legitimate way to resolve this issue is to contact the site administrator and inquire why your Cloudflare Ray ID and IP Address are blocked, as indicated on the error page.

You may also like

Leave a Comment