This article covers how to use the Cloudflare WAF to limit access to your website to only certain countries.
Related Articles
Use AbuseIPDB with CSF (ConfigServer Firewall)
How to Install CSF for Better cPanel Server Security
AutoSSL with Cloudflare
IMPORTANT: This guide requires you have Cloudflare enabled on your site.
Block Specific Country/Countries
- Log in to your Cloudflare dashboard, and select your account and domain.
-
Click on Security > Security Rules.
NOTE: If prompted, choose the new Cloudflare Dashboard. -
Select +Create Rule > Custom Rules.
-
Fill out the "When incoming requests match" field with Field (Country), Operator (is in), and the Value.
NOTE: Under Value you can enter one or more countries. These are the countries that will not be able to access your website. -
Choose an Action
- Block - This blocks the visitors of your selected countries.
-
Interactive Challenge - This allows visitors of your selected countries but only if they pass a bot challenge.
NOTE: Information on all actions can be found in the Cloudflare documentation.
- Click Deploy.
Limit to Specific Country/Countries
- Log in to your Cloudflare dashboard, and select your account and domain.
-
Click on Security > Security Rules.
NOTE: If prompted, choose the new Cloudflare Dashboard. -
Select +Create Rule > Custom Rules.
-
Fill out the "When incoming requests match" field with Field (Country), Operator (is not in), and the Value.
NOTE: Under Value you can enter one or more countries. These are the countries that will be able to access your website. -
Choose an Action
- Block - This blocks the visitors outside of your selected countries.
-
Interactive Challenge - This allows visitors outside of your selected countries but only if they pass a bot challenge.
NOTE: Information on all actions can be found in the Cloudflare documentation.
- Click Deploy.
Comments
0 comments
Article is closed for comments.