IP2Location Nginx module enables user to easily perform client's IP to geographical location lookup by using IP2Location database.
Supported IPv4 and IPv6 address.
For more details, please visit: https://www.ip2location.com/developers/nginx
- Download IP2location C library from https://www.ip2location.com/developers/c
- Change the path to IP2Location library in "ngx_http_ip2location_module.c".
- Re-compile Nginx from source to include this module. Add the below directive into the compile of Nginx: ./configure --add-module=/absolute/path/to/nginx-ip2location-1.0
- make install
Change your Nginx config file to include the 'ip2location_database' directive:
The following variables will be made available in Nginx:
Sample BIN Databases
- Download free IP2Location LITE databases at https://lite.ip2location.com
- Download IP2Location sample databases at https://www.ip2location.com/developers