=encoding utf-8 =head1 NAME ngx_stream_geoip_module - Module ngx_stream_geoip_module =head1 The C module (1.11.3) creates variables with values depending on the client IP address, using the precompiled L 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 C<--with-stream_geoip_module> configuration parameter. B This module requires the L library. =head1 Example Configuration 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; } ... } =head1 Directives =head2 geoip_country B geoip_country I>> B I Specifies a database used to determine the country depending on the client IP address. The following variables are available when using this database: =over =item C<$geoip_country_code> two-letter country code, for example, “C”, “C”. =item C<$geoip_country_code3> three-letter country code, for example, “C”, “C”. =item C<$geoip_country_name> country name, for example, “C”, “C”. =back =head2 geoip_city B geoip_city I>> B I 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: =over =item C<$geoip_area_code> telephone area code (US only). B This variable may contain outdated information since the corresponding database field is deprecated. =item C<$geoip_city_continent_code> two-letter continent code, for example, “C”, “C”. =item C<$geoip_city_country_code> two-letter country code, for example, “C”, “C”. =item C<$geoip_city_country_code3> three-letter country code, for example, “C”, “C”. =item C<$geoip_city_country_name> country name, for example, “C”, “C”. =item C<$geoip_dma_code> DMA region code in US (also known as “metro code”), according to the L in Google AdWords API. =item C<$geoip_latitude> latitude. =item C<$geoip_longitude> longitude. =item C<$geoip_region> two-symbol country region code (region, territory, state, province, federal land and the like), for example, “C<48>”, “C”. =item C<$geoip_region_name> country region name (region, territory, state, province, federal land and the like), for example, “C”, “C”. =item C<$geoip_city> city name, for example, “C”, “C”. =item C<$geoip_postal_code> postal code. =back =head2 geoip_org B geoip_org I>> B I Specifies a database used to determine the organization depending on the client IP address. The following variable is available when using this database: =over =item C<$geoip_org> organization name, for example, “The University of Melbourne”. =back