Using GeoIP2

Peter Fraser softwareinfojam at gmail.com
Thu Jun 20 01:05:13 UTC 2019


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190619/d6152bf9/attachment-0001.html>


More information about the nginx mailing list