Resource icon

Registration Country Ban via Cloudflare

rdn

Well-known member
rdn submitted a new resource:

Registration Country Ban via Cloudflare - No XF addon required

Visit: https://dash.cloudflare.com/
You XenForo Domain > Firewall Menu > Firewall Rules > Create a Firewall rule

Rule name: Registration Country Ban
Expression Preview > Edit expression
Modify the country codes/domain:
ip.geoip.country in {"BD" "BR" "CN" "KP" "KR" "PK" "RU" "UA" "VN" "TH" "IR" "BG" "DE"} and http.request.full_uri contains "https://domain.com/register/"

Then…: Block
Hit Deploy, done.

Read more about this resource...
 
for the curious, the provided list includes

BD Bangladesh
BR Brazil
CN China
KP North Korea
KR South Korea
PK Pakistan
RU Russia
UA Ukraine
VN Vietnam
TH Thailand
IR Iran
BG Bulgaria
DE Germany

 
  • Like
Reactions: rdn
thanks for this - working beautifully and catching dozens (or hundreds) of unwanted registration attempts daily :)
 
  • Like
Reactions: rdn
any way to restrict it to only one country? my forum is basically india focused. thanks!

update: i guess this works: (ip.geoip.country ne "IN")!
 
Last edited:
Rule seems to work great so far! I don't see any reason why I can't also block this folder: /misc/contact

Do I need to write a whole new rule, or is there a way to say "OR" like maybe....

{"https://domain.com/register/" "https://domain.com/misc/contact"}
 
i assume this should work? (ps: i am excluding all countries except india in this)
Code:
(ip.geoip.country ne "IN" and http.request.full_uri contains "https://broadbandforum.co/register/") or (ip.geoip.country ne "IN" and http.request.full_uri contains "https://broadbandforum.co/misc/contact")

cloudflare has a pretty nice rule maker. very easy to customize.
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

i imagine bracket placement can be changed to shorten the code by putting OR between the two URLs? would need some testing though.
 
Back
Top Bottom