Articles

Fun Blocking Countries with CloudFlares Expression Builder

36
0

I’m in the US and I get more traffic from Russia, Singapore, India and a hand full of other countries than I care for eroding my client traffic metrics.

CloudFlare’s UI isn’t always great, but its expression builder is pretty sweet if you figure out how to use it. This solves about 99% of my traffic problems. Throw something like this in the expression builder and suddenly you get a new UI above it that is super easy to visually add more blocked countries too. Silly really.


(ip.src.country in {"CA" "LT" "AU" "IN" "SG" "IE" "PL" "CN" "TW" "RU" "NL" "SG" "DE" "HK" "MY" "FR" "HU" "BR"})