Opened 4 years ago

Closed 4 years ago

#1130 closed defect (invalid)

GeoIP module does not work on 1.10.2

Reported by: hristo.iliev@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.10.x
Keywords: http_geoip_module Cc:
uname -a: Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.81-2 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.2
built with OpenSSL 1.0.2j 26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx-1.10.2 --with-http_stub_status_module --with-openssl=../openssl-1.0.2j --with-http_ssl_module --with-http_v2_module --with-http_geoip_module


http_geoip_module stopped working in version 1.10.2 . With same configure options and same config file it is works with version 1.10.1 . In latest version at least GEOIP_COUNTRY_CODE is not set (I use only geoip_country directive).

Change History (5)

comment:1 by Maxim Dounin, 4 years ago

The geoip module is not expected to set GEOIP_COUNTRY_CODE. If you see a problem, please provide more details - what exactly is in your configuration, what you expect to happen, and what happens instead. We need a way to reproduce the problem.

comment:2 by hristo.iliev@…, 4 years ago

I have two installations of nginx - 1.10.1 and 1.10.2 on same server with same configuration options and same config file. In config file, related to geoip, I have only:

geoip_country           /usr/local/GeoIP/GeoIP.dat;

In version 1.10.1 I can do with PHP


and it return country code correctly, in version 1.10.2 it's not defined. PHP code is same, geoip library is same, geoip database is same. So I think something is changed in nginx. How can I debug more ?

comment:3 by Maxim Dounin, 4 years ago

The GEOIP_COUNTRY_CODE is not something that is expected to appear automatically on PHP side once you enable geoip_country directive in the nginx configuration. If it is available in PHP, there should be something else in the configuration which makes it available.

Grep your previous installation configs for GEOIP_COUNTRY_CODE to find out how it was made available to php in your previous configuration - most likely, there is something like

fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;

somewhere in your config, probably in the fastcgi_params file.

comment:4 by hristo.iliev@…, 4 years ago

Ouch that's right. I forgot fastcgi_params. I'm really sorry. Thank you and you can close this.

comment:5 by Maxim Dounin, 4 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.