Member-only story
Introduction
In this post, I will cover the topic of Identifying a Country or City by IP Address on an NGINX Server. GeoLite2 this a DB has been created by MaxMind to identify countries and cities by IP address. There is a commercial version of GeoIP2 and an open source version of GeoLite2 , however, to be able to download this database, we must create an account at https://www.maxmind.com/
Environment
- Ubuntu 18.04
- NGINX (latest stable version)
- GeoIP2 module
- Free maxmind account (you will need to download databases)
Let’s start
- Install libmaxminddb
root@vagrant:/home/vagrant# add-apt-repository ppa:maxmind/ppaMore info: https://launchpad.net/~maxmind/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding itgpg: keyring `/tmp/tmpsm2acf17/secring.gpg' created
gpg: keyring `/tmp/tmpsm2acf17/pubring.gpg' created
gpg: requesting key DE742AFA from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpsm2acf17/trustdb.gpg: trustdb created
gpg: key DE742AFA: public key "Launchpad PPA for MaxMind" imported
gpg: Total number processed: 1
gpg: imported: 1…