# Add following lines under `http` context: You need to configure Nginx to use IP2LOCATION module. # Download and decompress the latest IP2Location LITE database. Sign up an account for login and password. # Create new directory for IP2Location database. Free database is less accurate comparing to commercial database. IP2Location offers 5 free LITE databases and 24 commercial IP geolocation databases. # libIP2Location.so.1()(64bit) is needed by nginx-garena-1.16.1-0.noarch ![]() configure -add-module=./ip2location-nginx #include "/root/ip2location/IP2Location-C-Library-master/libIP2Location/IP2Location.h" # IP2Location library in "ngx_http_ip2location_module.c" Sudo apt-get install wget git build-essential zlib1g-dev libpcre3 libpcre3-dev libtool autoconf automake Sudo yum install wget git gcc-c++ pcre-devel zlib-devel make libtool autoconf automake # These are for RedHat, CentOS, and Fedora. ![]() configure -add-module=/absolute/path/to/nginx-ip2location-8.0.0Įdit your Nginx config file to point the correct path of IP2Location database file: Add the below directive into the compile of Nginx: Re-compile Nginx from source to include this module. Developers can use the API to query all IP2Location™ binary databases for IPv4 and IPv6 address.ĭownload IP2location C library from here.ĭownload and decompress this Nginx module package.Ĭhange the path to IP2Location library in “ngx_http_ip2location_module.c”. It has been optimized for speed and memory utilization. IP2Location C library enables the user to find the country, region, city, coordinates, ZIP code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type that any IP address or hostname originates from. In general, it is faster, easier and more accurate than reverse DNS lookups. This is an IP2Location Nginx Module that enables the user to identify the country code and country name by IP address. Geo IP solution to identify country, region, city, latitude & longitude, ZIP code, time zone, connection speed, ISP, domain name, IDD country code, area code, weather station data, mobile network codes (MNC), mobile country codes (MCC), mobile carrier, elevation and usage type. Please note that the below 49 countries that don't have the official ISO3166-2 subdivisions defined.Īnguilla, Antarctica, American Samoa, Aruba, Aland Islands, Saint Barthelemy, Bermuda, Bouvet Island, Cocos (Keeling) Islands, Cook Islands, Curacao, Christmas Island, Western Sahara, Falkland Islands (Malvinas), Faroe Islands, French Guiana, Guernsey, Gibraltar, Guadeloupe, Heard Island and Mcdonald Islands, South Georgia and The South Sandwich Islands, Guam, Hong Kong, Isle of Man, British Indian Ocean Territory, Jersey, Cayman Islands, Saint Martin (French Part), Macao, Northern Mariana Islands, Martinique, Montserrat, New Caledonia, Norfolk Island, Niue, French Polynesia, Saint Pierre and Miquelon, Pitcairn, Puerto Rico, Reunion, Svalbard and Jan Mayen, Sint Maarten (Dutch Part), Turks and Caicos Islands, French Southern Territories, Tokelau, Holy See, Virgin Islands, British, Virgin Islands, U.S., Mayotte.IP2Location主要是用于代替MaxMind GeoIP,原因是GeoIP数据库针对中国的Blacklist黑名单有非常高的误伤率,选择IP2Location可以有效降低误伤,为了业务需求得及时做出改变。在使用IP2Location的过程中发现官网的步骤还是存在一些问题,这里记录和分享下自己逐步解决问题的过程。 更新历史 Singapore - we categorize Singapore as a single subdivision.IP2Location™ geolocation database or service is compliant with ISO 3166-2 for all countries except, You can easily retrieve the ISO3166-2 code by mapping the country code and subdivision name. This data contains the ISO3166-2 code for the states/regions used in our geolocation database. ![]() ![]() IP2Location™ ISO 3166-2 Subdivision Code is a free data offered for your download.
0 Comments
Leave a Reply. |