This module helps you to block entire countries from visiting your site (and generating massive page load), if you are using the free plan of Cloudflare protection.
It might be the case that you are getting spammed by accesses from various IPs and your server, delivering the requested pages, gets to its physical limits.
If the attacker uses just one IP address (or a range), you might consider using the ip_ranges module. However if the IP addresses constantly change, but all of them have the same (or a few) country names, you might want to go and block these entire countries from accessing your site.
To achieve this, you must guide the traffic to your site via Cloudflare. The enterprise plan would already allow you to block countries on Cloudflare, but the free plan does not have this option.
Cloudflare adds a header information containing the originating country code, on which we can effectively block these requests.
Install this module and configure it via "/admin/config/system/cloudflare-country-block". You can choose the entire behavior, the countries that should be blocked and the blocking mechanism.
Nice to know
It is possible that you lock yourself out, mostly on development environments where you won't connect via CloudFlare. To disable the module's functionality entirely on local environments, you can overwrite the following setting in your settings.local.php:
$conf['cloudflare_country_block_enabled'] = FALSE;
Project information
Unsupported
Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projectsNo further development
No longer developed by its maintainers.- Project categories: Access control, Performance, Security
1 site reports using this module
- Created by florianmuellerch on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.

