# HG changeset patch # User Yaroslav Zhuravlev # Date 1468433755 -10800 # Node ID 0e591e97737c9b369be7c5912c2c2599cabe9689 # Parent 153a99d252109831dec3b2735a8d4c6ec98fd990 Documented the geoip module in stream. diff -r 153a99d25210 -r 0e591e97737c xml/en/GNUmakefile --- a/xml/en/GNUmakefile Tue Jul 05 21:47:42 2016 +0300 +++ b/xml/en/GNUmakefile Wed Jul 13 21:15:55 2016 +0300 @@ -96,6 +96,7 @@ mail/ngx_mail_ssl_module \ stream/ngx_stream_access_module \ stream/ngx_stream_core_module \ + stream/ngx_stream_geoip_module \ stream/ngx_stream_limit_conn_module \ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ diff -r 153a99d25210 -r 0e591e97737c xml/en/docs/index.xml --- a/xml/en/docs/index.xml Tue Jul 05 21:47:42 2016 +0300 +++ b/xml/en/docs/index.xml Wed Jul 13 21:15:55 2016 +0300 @@ -8,7 +8,7 @@
@@ -492,6 +492,11 @@ + +ngx_stream_geoip_module + + + ngx_stream_limit_conn_module diff -r 153a99d25210 -r 0e591e97737c xml/en/docs/stream/ngx_stream_geoip_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/stream/ngx_stream_geoip_module.xml Wed Jul 13 21:15:55 2016 +0300 @@ -0,0 +1,213 @@ + + + + + + + + +
+ + +The ngx_stream_geoip_module module (1.11.3) creates variables +with values depending on the client IP address, using the precompiled +MaxMind databases. + + + +When using the databases with IPv6 support, +IPv4 addresses are looked up as IPv4-mapped IPv6 addresses. + + + +This module is not built by default, it should be enabled with the +--with-stream_geoip_module +configuration parameter. + +This module requires the +MaxMind GeoIP library. + + + +
+ + +
+ + + +stream { + geoip_country GeoIP.dat; + geoip_city GeoLiteCity.dat; + + map $geoip_city_continent_code $nearest_server { + default example.com; + EU eu.example.com; + NA na.example.com; + AS as.example.com; + } + ... +} + + + +
+ + +
+ + +file + +stream + + +Specifies a database used to determine the country +depending on the client IP address. +The following variables are available when using this database: + + +$geoip_country_code + +two-letter country code, for example, +“RU”, “US”. + + +$geoip_country_code3 + + +three-letter country code, for example, +“RUS”, “USA”. + + +$geoip_country_name + +country name, for example, +“Russian Federation”, “United States”. + + + + + + + + + +file + +stream + + +Specifies a database used to determine the country, region, and city +depending on the client IP address. +The following variables are available when using this database: + + +$geoip_area_code +telephone area code (US only). + +This variable may contain outdated information since +the corresponding database field is deprecated. + + + + +$geoip_city_continent_code +two-letter continent code, for example, +“EU”, “NA”. + + +$geoip_city_country_code + + +two-letter country code, for example, +“RU”, “US”. + + +$geoip_city_country_code3 + + +three-letter country code, for example, +“RUS”, “USA”. + + +$geoip_city_country_name + + +country name, for example, +“Russian Federation”, “United States”. + + +$geoip_dma_code + +DMA region code in US (also known as “metro code”), according to the +geotargeting +in Google AdWords API. + + +$geoip_latitude +latitude. + +$geoip_longitude +longitude. + +$geoip_region + +two-symbol country region code (region, territory, state, province, federal land +and the like), for example, +“48”, “DC”. + + +$geoip_region_name + +country region name (region, territory, state, province, federal land +and the like), for example, +“Moscow City”, “District of Columbia”. + + +$geoip_city + +city name, for example, +“Moscow”, “Washington”. + + +$geoip_postal_code + +postal code. + + + + + + + + + +file + +stream + + +Specifies a database used to determine the organization +depending on the client IP address. +The following variable is available when using this database: + + +$geoip_org + +organization name, for example, “The University of Melbourne”. + + + + + + + +
+ +
diff -r 153a99d25210 -r 0e591e97737c xml/ru/GNUmakefile --- a/xml/ru/GNUmakefile Tue Jul 05 21:47:42 2016 +0300 +++ b/xml/ru/GNUmakefile Wed Jul 13 21:15:55 2016 +0300 @@ -85,6 +85,7 @@ mail/ngx_mail_ssl_module \ stream/ngx_stream_access_module \ stream/ngx_stream_core_module \ + stream/ngx_stream_geoip_module \ stream/ngx_stream_limit_conn_module \ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ diff -r 153a99d25210 -r 0e591e97737c xml/ru/docs/index.xml --- a/xml/ru/docs/index.xml Tue Jul 05 21:47:42 2016 +0300 +++ b/xml/ru/docs/index.xml Wed Jul 13 21:15:55 2016 +0300 @@ -8,7 +8,7 @@
@@ -496,6 +496,11 @@ + +ngx_stream_geoip_module + + + ngx_stream_limit_conn_module diff -r 153a99d25210 -r 0e591e97737c xml/ru/docs/stream/ngx_stream_geoip_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/ru/docs/stream/ngx_stream_geoip_module.xml Wed Jul 13 21:15:55 2016 +0300 @@ -0,0 +1,214 @@ + + + + + + + + +
+ + +Модуль ngx_stream_geoip_module (1.11.3) создаёт переменные, +значения которых зависят от IP-адреса клиента, используя готовые базы данных +MaxMind. + + + +При использовании баз данных с поддержкой IPv6 +IPv4-адреса ищутся отображёнными на IPv6. + + + +По умолчанию этот модуль не собирается, его сборку необходимо +разрешить с помощью конфигурационного параметра +--with-stream_geoip_module. + +Для сборки и работы этого модуля нужна библиотека +MaxMind GeoIP. + + + +
+ + +
+ + + +stream { + geoip_country GeoIP.dat; + geoip_city GeoLiteCity.dat; + + map $geoip_city_continent_code $nearest_server { + default example.com; + EU eu.example.com; + NA na.example.com; + AS as.example.com; + } + ... +} + + + +
+ + +
+ + +файл + +stream + + +Задаёт базу данных для определения страны в зависимости +от значения IP-адреса клиента. +При использовании этой базы данных доступны следующие переменные: + + +$geoip_country_code + +двухбуквенный код страны, например, +“RU”, “US”. + + +$geoip_country_code3 + + +трёхбуквенный код страны, например, +“RUS”, “USA”. + + +$geoip_country_name + +название страны, например, +“Russian Federation”, “United States”. + + + + + + + + + +файл + +stream + + +Задаёт базу данных для определения страны, региона и города +в зависимости от значения IP-адреса клиента. +При использовании этой базы данных доступны следующие переменные: + + +$geoip_area_code +телефонный код области (только для США). + +Данная переменная может содержать неактуальную информацию, т.к. +соответствующее поле базы данных объявлено устаревшим. + + + + +$geoip_city_continent_code + +двухбуквенный код континента, например, +“EU”, “NA”. + + +$geoip_city_country_code + + +двухбуквенный код страны, например, +“RU”, “US”. + + +$geoip_city_country_code3 + + +трёхбуквенный код страны, например, +“RUS”, “USA”. + + +$geoip_city_country_name + + +название страны, например, +“Russian Federation”, “United States”. + + +$geoip_dma_code + +DMA-код региона в США (также известный как “код агломерации”), согласно +геотаргетингу +Google AdWords API. + + +$geoip_latitude +широта. + +$geoip_longitude +долгота. + +$geoip_region + +двухсимвольный код региона страны (область, край, штат, +провинция, федеральная земля и тому подобное), например, +“48”, “DC”. + + +$geoip_region_name + +название региона страны (область, край, штат, +провинция, федеральная земля и тому подобное), например, +“Moscow City”, “District of Columbia”. + + +$geoip_city + +название города, например, +“Moscow”, “Washington”. + + +$geoip_postal_code + +почтовый индекс. + + + + + + + + + +файл + +stream + + +Задаёт базу данных для определения названия организации +в зависимости от значения IP-адреса клиента. +При использовании этой базы данных доступна следующая переменная: + + +$geoip_org + +название организации, например, “The University of Melbourne”. + + + + + + + +
+ +