Howto set geoip_country for IPv4 and IPv6 databases?

Bruno Prémont bruno.premont at
Tue Jan 15 08:08:30 UTC 2013


It should be sufficient to just list the IPv6 database (which includes
the IPv4 database as mapped addresses) tough 1.2.x branch needs
attached patch.

I don't know if Maxim has already applied it or a variant of it to
1.3.x branch.

Also search the archives for GeoIP and IPv6 support, there were a few
posts about it.

Attached patch was initially posted in
(though I've updated it for 1.2.2).


On Tue, 15 Jan 2013 05:08:15 +0100 Patrick Lists wrote:
> Hi,
> Next to their IPv4 country and city database, Maxmind now also has an 
> IPv6 country and city database at
> Is there a way I can make geo use the IPv6 databases too?
> This does not work:
> geoip_country /etc/nginx/GeoIP.dat;
> geoip_country /etc/nginx/GeoIPv6.dat;
> geoip_city /etc/nginx/GeoLiteCity.dat;
> geoip_city /etc/nginx/GeoLiteCityv6.dat;
> Because I see this error when checking the config:
> nginx: [emerg] "geoip_country" directive is duplicate in 
> /etc/nginx/nginx.conf:116
> Thanks for any advice.
> Regards,
> Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-1.2.2-geoip.patch
Type: text/x-patch
Size: 10108 bytes
Desc: not available
URL: <>

More information about the nginx mailing list