forked from chaizhenhua/ngx-ip2location
-
Notifications
You must be signed in to change notification settings - Fork 0
Nginx IP2Location Module
License
admobitec/ngx-ip2location
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Nginx IP2Location Module ======================== This is a IP2Location Nginx Module that enables the user to identify the country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code and weather by IP address. Requirements ------------ 1. 1. IP2Location C API library ( download from http://www.ip2location.com/developers/c.aspx ) 2. Nginx (version > 0.5) Installation ------------ 1. Install dependencies: # These are for RedHat, CentOS, and Fedora. $ sudo yum install gcc-c++ pcre-dev pcre-devel zlib-devel make libtool # These are for Debian. Ubuntu will be similar. $ sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev libtool 2. Download & Install IP2Location $ wget http://www.ip2location.com/downloads/ip2location-c-7.0.0.tar.gz $ tar xvfz ip2location-c-7.0.0.tar.gz $ cd ip2location-c-7.0.0 $ ./configure $ make $ sudo make install 3. Download & Install Nginx & ngx-ip2location $ wget http://nginx.org/download/nginx-VERSION.tar.gz $ tar -xvzf nginx-VERSION.tar.gz $ cd nginx-VERSION $ ./configure --add-module=/path/to/ngx-ip2location $ make $ sudo make install Module Configuration -------------------- Syntax: ip2location on|off Default: off Context: http, server, location Description: enable or disable ip2location Syntax: ip2location_database path Default: none Context: http Description: specifies the ip2location bin file Syntax: ip2location_access_type file_io|shared_memory|cache_memory Default: shared_memory Context: http Description: specifies to where the iplocation DB file will be loaded. Syntax: ip2location_proxy cidr|address Default: none Context: http Description: sets a list of proxies to translate x-forwarded-for headers for Syntax: ip2location_proxy_recursive on|off Default: off Context: http Description: enables recursive search in the x-forwarded-for address list Variables --------- ip2location_country_short ip2location_country_long ip2location_region ip2location_city ip2location_isp ip2location_latitude ip2location_longitude ip2location_domain ip2location_zipcode ip2location_timezone ip2location_netspeed ip2location_iddcode ip2location_areacode ip2location_weatherstationcode ip2location_weatherstationname ip2location_mcc ip2location_mnc ip2location_elevation ip2location_usagetype Config Example -------------- nginx.conf.example
About
Nginx IP2Location Module
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C 94.6%
- PHP 5.4%