Welcome! Log In Create A New Profile

Advanced

Re: Handling cities with the same name using the GeoIP module

Maxim Dounin
November 14, 2021 04:26PM
Hello!

On Sun, Nov 14, 2021 at 12:54:47PM -0500, YvorL wrote:

> I see. It's weird that I can't use a column that's right there in the
> database and would uniquely identify any entry.

That's because there is no such column in the database nginx uses.
Note that GeoIP modules uses GeoIP databases, not GeoIP2.

> When I checked the Nginx documentation, I saw this:
> "$geoip_region
> two-symbol country region code (region, territory, state, province, federal
> land and the like), for example, ā€œ48ā€, ā€œDCā€."
> That should be the "subdivision_1_iso_code" in the database.

That's, literally, "region code" in the database:

https://dev.maxmind.com/geoip/legacy/databases?lang=en#geoip-legacy-city-csv-database-fields

> Meanwhile, when I logged my activity, I saw the name of the region
> (subdivision_1_name) in the logs and when I changed to "$geoip_region_name"
> nothing was logged.

This probably means that GeoIP library provides no meaningful name
for the region. Region names are hardcoded in the library, so you
can check if it's present here:

https://github.com/maxmind/geoip-api-c/blob/1a88de37a1e9001a7207ed2961477634b9efba97/libGeoIP/regionName.c

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Handling cities with the same name using the GeoIP module

YvorL November 12, 2021 09:21AM

Re: Handling cities with the same name using the GeoIP module

Maxim Dounin November 12, 2021 09:58AM

Re: Handling cities with the same name using the GeoIP module

YvorL November 14, 2021 12:54PM

Re: Handling cities with the same name using the GeoIP module

Maxim Dounin November 14, 2021 04:26PM

Re: Handling cities with the same name using the GeoIP module

YvorL November 15, 2021 08:46AM

Re: Handling cities with the same name using the GeoIP module

Maxim Dounin November 15, 2021 10:14AM

Re: Handling cities with the same name using the GeoIP module

YvorL November 15, 2021 10:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready