Hello,
I want to exclude all countrys and only whitelists some special countrys on my website to protect agains attacks from that countrys.
I have activated 'IP Geolocation' in my Cloudflare network configuration.
Can i now add this little snipped in additional nginx part as below:
Is that enought? Maybe better than return redirect to a external website, so a get/request flood can not be effective?
Or better to work with fail2ban?
Using CloudFlare for country blocking - Nginx Library
I want to exclude all countrys and only whitelists some special countrys on my website to protect agains attacks from that countrys.
I have activated 'IP Geolocation' in my Cloudflare network configuration.
Can i now add this little snipped in additional nginx part as below:
map $http_cf_ipcountry $allow {
default no;
DE yes;
FR yes;
}
if ($allow = no) {
return 403;
}
Is that enought? Maybe better than return redirect to a external website, so a get/request flood can not be effective?
Or better to work with fail2ban?
Using CloudFlare for country blocking - Nginx Library
Last edited: