http.geoip Plugin

This feature does not come with Caddy by default. To get it, select the http.geoip plugin when you download Caddy.

geoip is a Caddy plugin that allow to determine user Geolocation by IP address using MaxMind database.

Full documentation

Examples

Proxy pass headers to backend

localhost geoip /path/to/db/GeoLite2-City.mmdb proxy / localhost:3000 { header_upstream Country-Name {geoip_country_name} header_upstream Country-Code {geoip_country_code} header_upstream Country-Eu {geoip_country_eu} header_upstream City-Name {geoip_city_name} header_upstream Latitude {geoip_latitude} header_upstream Longitude {geoip_longitude} header_upstream Time-Zone {geoip_time_zone} }

This will pass Country-Name/Country-Code.. etc. headers to you backend and you must get it like r.Header.Get("Country-Name") or other way related to you backend language/framework

Related Links

Documentation

Access the full documentation for this plugin off-site:

Docs

Plugin Help

Get help from the maintainers of the http.geoip plugin:

Support

Plugin Website

Visit http.geoip’s website for more information:

Website

Plugin Author: Andrey Blinov

Last Updated: 27 Mar 2018, 7:38 AM

This plugin is independent of the Caddy project and is not endorsed or maintained by Caddy developers. Use at your own risk. Do not file issues for this plugin on Caddy’s bug tracker.