• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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