Nginx and GeoLite2

Hi
I am planning to use GeoLite with nginx. On the MaxMind website there is
an announcement:

Announcement
Free access to the latest in IP geolocation databases is now available
in our GeoLite2 Databases

I’ve used this db but nginx returned the error. Is it possible to use
GeoLite2?

Nginx version - latest devel.

Hello!

On Mon, Oct 21, 2013 at 12:38:30PM +0300, wishmaster wrote:

Hi
I am planning to use GeoLite with nginx. On the MaxMind website there is an
announcement:

Announcement
Free access to the latest in IP geolocation databases is now available in our
GeoLite2 Databases

I’ve used this db but nginx returned the error. Is it possible to use GeoLite2?

GeoLite2 databases use different format and different libraries
are needed to access them. They are new and not supported by
nginx.

Use GeoLite databases instead (without “2”). Or use a CSV
version, a perl script to convert CSV files from MaxMind to nginx
ngx_http_geo_module configuration is in contrib.


Maxim D.
http://nginx.org/en/donation.html

Am Mon, 21 Oct 2013 17:12:51 +0400
schrieb Maxim D. [email protected]:

available in our GeoLite2 Databases

I’ve used this db but nginx returned the error. Is it possible to
use GeoLite2?

GeoLite2 databases use different format and different libraries
are needed to access them. They are new and not supported by
nginx.

Use GeoLite databases instead (without “2”).

Does anyone know, will the GeoLite databases still be around?
Or will we all be forced to go the CSV-export route?

Hi,

— Original message —
From: “Maxim D.” [email protected]
Date: 21 October 2013, 16:13:01

I’ve used this db but nginx returned the error. Is it possible to use
GeoLite2?

GeoLite2 databases use different format and different libraries
are needed to access them. They are new and not supported by
nginx.

Use GeoLite databases instead (without “2”). Or use a CSV
version, a perl script to convert CSV files from MaxMind to nginx
ngx_http_geo_module configuration is in contrib.

Unfortunately, v2 of this db is not shipped in CSV format. Binary
format only.
See http://dev.maxmind.com/geoip/geoip2/geolite2/

Max, are you planning to add support of GeoLite2 in nginx in nearest
future?

Hello!

On Mon, Oct 21, 2013 at 07:51:23PM +0300, wishmaster wrote:

On Mon, Oct 21, 2013 at 12:38:30PM +0300, wishmaster wrote:
are needed to access them. They are new and not supported by
nginx.

Use GeoLite databases instead (without “2”). Or use a CSV
version, a perl script to convert CSV files from MaxMind to nginx
ngx_http_geo_module configuration is in contrib.

Unfortunately, v2 of this db is not shipped in CSV format. Binary format only.
See http://dev.maxmind.com/geoip/geoip2/geolite2/

As far as I can tell, the only difference between GeoLite and
GeoLite2 is format.

At least the http://www.maxmind.com/en/opensource page makes me
think so, as a link to the GeoLite2 page annotated as “(New
format)”.

Max, are you planning to add support of GeoLite2 in nginx in nearest future?

No.


Maxim D.
http://nginx.org/en/donation.html

On Mon, Oct 21, 2013 at 09:53:42PM +0400, Maxim D. wrote:

Hello!

As far as I can tell, the only difference between GeoLite and
GeoLite2 is format.

At least the http://www.maxmind.com/en/opensource page makes me
think so, as a link to the GeoLite2 page annotated as “(New
format)”.

v2 databases require access via v2 API:
https://github.com/maxmind/libmaxminddb/blob/master/doc/libmaxminddb.md

http://dev.maxmind.com/geoip/geoip2/whats-new-in-geoip2/
http://dev.maxmind.com/geoip/geoip2/geolite2/

Max, are you planning to add support of GeoLite2 in nginx in nearest future?

No.

I’d expand on this: not until the new C API is released.
(Currently, it’s declared beta and subject to change.)

Hi,

If you’re still looking to use the GeoIP2/GeoLite2 databases, a module
is
now available at https://github.com/leev/ngx_http_geoip2_module.

Cheers,
Lee

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,243887,249663#msg-249663

leev Wrote:

Hi,

If you’re still looking to use the GeoIP2/GeoLite2 databases, a module
is now available at https://github.com/leev/ngx_http_geoip2_module.

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:
http://forum.nginx.org/read.php?2,243887,251292#msg-251292