# leev/ngx_http_geoip2_module

Nginx GeoIP2 module

Repository: https://github.com/leev/ngx_http_geoip2_module
Canonical: https://ross.abutalabs.com/products/ngx_http_geoip2_module
Language: C
License: BSD-2-Clause
License Family: permissive
Last push: 2024-04-02T21:25:17+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4598, "days_push": 883, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1140, forks 214 (observed 2026-08-28T04:03:44.291936+00:00)

## What it is
An Nginx module that creates variables from MaxMind GeoIP2 databases based on client IP addresses, supporting both IPv4 and IPv6. It works with both the HTTP and stream subsystems and can be built as a static or dynamic module.

## Use cases
- serve different content based on visitor country
- block or redirect traffic from specific countries
- log client city and country in nginx access logs
- pass geolocation data to backend apps via fastcgi params
- geolocate clients in nginx stream (TCP/UDP) proxies
- auto-reload MaxMind database files without restarting nginx

## When to choose
- you run nginx and need geolocation lookups at the web server layer
- you want to use MaxMind GeoIP2/GeoLite2 mmdb databases
- you need geolocation for both HTTP and stream traffic
- you prefer a lightweight C module over application-level geo lookups

## When to avoid
- you don't control nginx compilation or can't load dynamic modules
- you need geolocation in an application server rather than nginx
- you use legacy GeoIP (dat) databases instead of GeoIP2
- you need a pure-Lua or dynamically scripted solution like OpenResty

## Facets
- artifact type: plugin
- maturity: stable
- function: middleware, networking, developer-tools
- domain: web-development, backend, networking, apis
- platform: -
- tags: nginx-module, geoip, maxmind, geoip2, geolocation, c, stream-module, linux, web-server, nginx

## Member repositories
- leev/ngx_http_geoip2_module (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:44.291936+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:35:32.547904+00:00, confidence not recorded.
  - readme: https://github.com/leev/ngx_http_geoip2_module (fetched 2026-08-28T04:03:44.291936+00:00, sha 22bae3231caf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
