Welcome! Log In Create A New Profile

Advanced

Using GeoIP2

Peter Fraser
June 19, 2019 09:06PM
Hi All,
I had GeoIP work on nginx 1.14.x. I upgrade to nginx 1.16.x and the whole thing broke so I decided to just upgrade to GeoIP2. I have the following below in nginx.conf which I saw on the nginx page.

load_module "/usr/local/libexec/nginx/ngx_http_geoip2_module.so";
load_module "/usr/local/libexec/nginx/ngx_http_headers_more_filter_module.so";


http {
geoip2 /usr/local/etc/nginx/GeoIP2/GeoIP2-Country.mmdb {
auto_reload 5m;
$geoip2_metadata_country_build metadata build_epoch;
$geoip2_data_country_code default=US source=$variable_with_ip country iso_code;
$geoip2_data_country_name country names en;
}

.. . .

I am realizing I don’t fully understand what all this does. The part source=$variable_with_ip country iso_code. I am trying to understand, what should go there.


Thanks for any help.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Using GeoIP2

Peter Fraser June 19, 2019 09:06PM

Re: Using GeoIP2

Francis Daly June 21, 2019 03:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
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