I block all Chinese User in Nginx
map $http_cf_ipcountry $allow {
default yes;
CN no;
}
if ($allow = no) {
return 403;
}
BUT I have only one webpage which I want to allow all User include Chinese User. How to allow it ?
I block all Chinese User in Nginx
map $http_cf_ipcountry $allow {
default yes;
CN no;
}
if ($allow = no) {
return 403;
}
BUT I have only one webpage which I want to allow all User include Chinese User. How to allow it ?
Login to your dashboard, go to the Firewall tab and create a new rule:
If country equals CN → Action: block
If you still need to block it in nginx:
It’s easier to use Firewall Rules here to first Allow full access to that Page, then Block CN access to the site.
I’m pretty sure this will work if you have the rules in the correct order.
thank you for your sugguestion
BUt cause i use the free plan ,so i dont have permission to use country block in Cloudflare
You can use Country Blocks in Firewall Rules on the free plan.
What sdayman said. You cant block countries with access rules but you can with firewall rules.
Oh thank you
I found it
my appreciate
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.