Block country with IP2Location Nginx Module
server {
.
.
.
if ( $ip2location_country_code = CN ) {
set $need_block Y;
}
if ( $remote_addr = 1.2.3.4 ) {
set $need_block N;
}
if ( $need_block = Y ) {
return 403;
break;
}
.
.
.
}
Comments
0 B
|👍
/👎
0 B
|👍
/👎