• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How to block countries via Cloudflare's HTTP_CF_IPCOUNTRY data?

Richard Grevers

New Pleskian
Hi,
we have one Drupal site which is costing a fortune in spurious International traffic. We are using cloudflare, which is reducing much traffic, but not enough, since many requests are to non-cacheable pages.

I have turned on the HTTP_CF_IPCOUNTRY header at cloudflare, so every request for this site will contain the country of origin. The requests are coming from a wide range of IP addresses but predominantly from certain countries - the usual suspects. Since this is country-specific, blocking these countries won't hurt too much.
Options via Drupal are no use because it's forbidden page is still 200KB

So I'm looking for a solution that happens before Drupal receives the request, and which responds in as few bytes as possible and with the error code most likely to make the bots give up.
 
Back
Top