How to allow a webpage in Nginx

nginx

#1

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 ?


#2

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:


#3

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.


#4

thank you for your sugguestion
BUt cause i use the free plan ,so i dont have permission to use country block in cloudflare


#5

You can use Country Blocks in Firewall Rules on the free plan.


#6

What sdayman said. You cant block countries with access rules but you can with firewall rules.


#7

Oh thank you
I found it


#8

my appreciate


closed #9

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.