https://github.com/chrislim2888/ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
https://github.com/chrislim2888/ip2location-nginx
area-code city country domain elevation geolocation ip-address ip-location ip-lookup ip2location iplocation ipv4 ipv6 isp mobile-info nginx region weather-station zip-code
Last synced: 23 days ago
JSON representation
Nginx module that allows user to lookup for geolocation information using IP2Location database.
- Host: GitHub
- URL: https://github.com/chrislim2888/ip2location-nginx
- Owner: chrislim2888
- License: other
- Created: 2014-05-12T03:37:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-03T06:57:36.000Z (over 1 year ago)
- Last Synced: 2025-03-26T23:11:13.081Z (about 1 month ago)
- Topics: area-code, city, country, domain, elevation, geolocation, ip-address, ip-location, ip-lookup, ip2location, iplocation, ipv4, ipv6, isp, mobile-info, nginx, region, weather-station, zip-code
- Language: C
- Homepage: https://www.ip2location.com
- Size: 4.88 KB
- Stars: 33
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
# IMPORTANT:
# THIS PROJECT WILL NO LONGER BE MAINTAINED. PLEASE VISIT https://github.com/ip2location/ip2location-nginx FOR THE LATEST UPDATE.# IP2Location Nginx
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](https://www.ip2location.com/developers/nginx)# Installation
1. Download IP2location C library from https://www.ip2location.com/developers/c
2. Change the path to IP2Location library in "ngx_http_ip2location_module.c".
3. 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
4. make
5. make install# Usage
Change your Nginx config file to include the 'ip2location_database' directive:ip2location_database /absolute/path/to/IP2LOCATION-LITE-DB1.BIN;
The following variables will be made available in Nginx:
$ip2location_country_code
$ip2location_country_name# Sample BIN Databases
* Download free IP2Location LITE databases at [https://lite.ip2location.com](https://lite.ip2location.com)
* Download IP2Location sample databases at [https://www.ip2location.com/developers](https://www.ip2location.com/developers)# Support
Email: [email protected].
URL: [https://www.ip2location.com](https://www.ip2location.com)