Country blocking using Nginx with GeoIP2 in Ubuntu 16.04

After try out the country block with multiple module, including the previous Nginx http_geoip_module, until I manage to figure it out and make it work, than only I found out that GeoIP version 1 will be stop update soon by Maxmind company, where they encourage developer to move to the next generation of IP database,…