nginx and GeoLite2

hdezela nginx-forum at
Sun Jun 29 06:17:27 UTC 2014

leev Wrote:
> Hi,
> If you're still looking to use the GeoIP2/GeoLite2 databases, a module
> is now available at
> Cheers,
> Lee

I've succesfully compiled the module but can't seem to get the correct
information from the database, I've followed the db structure that maxmind
has and the geoip2 section in nginx.conf is this:

     geoip2 /webdata/script/GeoLite2-City.mmdb {
          $geoip2_data_continent_code continent code;
          $geoip2_data_country_iso_code country iso_code;
          $geoip2_data_subdivision_name subdivision 0 names es;
          $geoip2_data_city_name city names es;
          $geoip2_data_latitude location latitude;
          $geoip2_data_longitude location longitude;

, I've also put the following in fastcgi_params:

fastcgi_param CONTINENT $geoip2_data_continent_code;
fastcgi_param COUNTRY $geoip2_data_country_iso_code;
fastcgi_param REGION $geoip2_data_subdivision_name;
fastcgi_param CITY $geoip2_data_city_name;
fastcgi_param LATITUDE $geoip2_data_latitude;
fastcgi_param LONGITUDE $geoip2_data_longitude;

...but the only variables I'm getting are CONTINENT, COUNTRY and CITY.

REGION, LATITUDE and LONGITUDE are not showing up...what do I need to do to
get those variables shown?

Posted at Nginx Forum:,243887,251292#msg-251292

More information about the nginx mailing list