Country Blocking with nginx GeoIP on Ubuntu/Debian
On Ubuntu/Debian, install nginx geoip module with apt install geoip-database libgeoip1 libnginx-mod-http-geoip -y Now edit nginx.conf vi /etc/nginx/nginx.conf Find http { Add below geoip_country /usr/share/GeoIP/GeoIP.dat; map $geoip_country_code $my_country_blocker { default no; US yes; AU yes; CA yes; } You can add 2 letter country code and set ye/no as required. To implement GeoIP blocking for … Read more