• Inviting everyone who uses WordPress management tools in Plesk
    The Plesk team is conducting a 60-minute research session that includes an interview and a moderated usability test.
    To participate, please use this link .
    Your experience will help shape product decisions and ensure the tools better support real-world use cases.

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