How to GeoIP block certain countries in Nginx with MaxMind
I spent too long thinking that ModSecurity was necessary for this, but you can do it with just the ngx_http_geoip2_module
Install nginx along with the module:
apt-get install nginx libnginx-mod-http-geoip2
Download the free GeoLite mmdb database from MaxMind into /etc/nginx/GeoLite2-Country.mmdb (you can and probably