]> git.kaiwu.me - nginx.git/commit
GeoIP: support for the MaxMind DB (MMDB) databases
authorSergey Kandaurov <s.kandaurov@f5.com>
Tue, 8 Sep 2026 19:56:49 +0000 (19:56 +0000)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 30 Sep 2026 16:17:54 +0000 (20:17 +0400)
commit2b5c2b605b5df669da5dec6749dcc76c07d1315d
treebc080bf97123736482d14cb7d396c733ac9ec60d
parentd30f68d82a1efe120308788f5b66ecdc9e6ef251
GeoIP: support for the MaxMind DB (MMDB) databases

The MaxMind DB format is now recognized, with the fallback to the
legacy format (reached End-of-Life in May 2022).  Migration requires
switching to MMDB database files:

    geoip_country  /usr/share/GeoIP/GeoLite2-Country.mmdb;
    geoip_city     /usr/share/GeoIP/GeoLite2-City.mmdb;
    geoip_org      /usr/share/GeoIP/GeoLite2-ASN.mmdb;

Either libmaxminddb or libGeoIP is sufficient to build the modules;
configure fails if neither is found.

Notes on the MMDB lookups:

*) $geoip_country_code3 and $geoip_city_country_code3 are converted from
   the alpha-2 codes with a compiled-in ISO 3166-1 table, as the MMDB
   databases provide alpha-2 codes only.

*) $geoip_org looks up "autonomous_system_organization", "isp",
   "organization", and "domain" in turn, to match the legacy ASNum, ISP,
   Org, and Domain database editions.

*) $geoip_area_code has no MMDB counterpart and is never found.

*) $geoip_region and $geoip_region_name come from subdivisions[0], and
   thus may differ in value from the legacy ones.

*) $geoip_dma_code comes from location.metro_code, which is deprecated
   by MaxMind and may be absent.

Co-authored-by: Nitin Swami <n.swami@f5.com>
auto/lib/geoip/conf
src/http/modules/ngx_http_geoip_module.c
src/stream/ngx_stream_geoip_module.c