Documentation

Recent changes

You are viewing a previous version of KrakenD Enterprise Edition (v1.3) , go to the latest version

GeoIP integration

The GeoIP integration allows you load Maxmind’s GeoIP2 City database (payment and free versions) and enrich all KrakenD calls to your backends with geo data.

To add GeoIP information to your backends, copy the Maxmind’s database file into the filesystem (it has to be a city DB) and specify its location in the configuration.

Configuration for GeoIP

Add the following extra_config in the root to your configuration file:

{
    "version": 2,
    "plugin": {
        "pattern":".so",
        "folder": "/opt/krakend/plugins/"
    },
    "extra_config": {
        "github_com/devopsfaith/krakend/transport/http/server/handler": {
            "name": ["krakend-geoip", "another-plugin-maybe" ],
            "krakend-geoip": {
                "citydb_path": "path/to/GeoIP2-City.mmdb"
            }
        }
    }
}
  • citydb_path: The path in the filesystem containing the database. Relative to the working dir or absolute path.

Data passed to backends

When the GeoIP plugin is enabled, all requests to the backend are enriched with a header X-GeoIP.

The following metadata is available. Keys that couldn’t retrieve its associated data show an empty value:

  • city
    • geoname_id: integer
    • names: list
  • continent
    • code: string
    • geoname_id: integer
    • names: list
  • country
    • geoname_id: integer
    • is_in_european_union: boolean
    • iso_code: string
    • names: list
  • location
    • accuracy_radius: integer
    • latitude: float
    • longitude: float
    • metro_code: integer
    • time_zone: string
  • postal
    • code: string
  • registered_country
    • geoname_id: integer
    • is_in_european_union: boolean
    • iso_code: string
    • names: list
  • represented_country
    • geoname_id: integer
    • is_in_european_union: boolean
    • iso_code: string
    • names: list
    • type: string
  • subdivisions
    • geoname_id: integer
    • iso_code: string
    • names: list
  • traits
    • is_anonymous_proxy: boolean
    • is_satellite_provider: boolean

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.

We use cookies to understand how you use our site and to improve your overall experience. By continuing to use our site, you accept our Privacy Policy. More information