Nginx block IP from behind cloudflare

By

•

min read

My profile

Share this:

Blocking IP for just one site (if you want to), without IPtables firewall or whatever:

map $http_cf_connecting_ip $blocked_ip {
	default 0;
	12.12.12.12 1;
}


# Then in your server or location block
if ($blocked_ip) {
    return 403;
}
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *