I follow nginx geoip configuration guide here http://www.howtoforge.com/nginx-how-to-block-visitors-by-country-with-the-geoip-module-debian-ubuntu
I write something like this
geoip_country /path/to/GeoIP.dat;
I am pretty sure the .dat file is there, and nginx has permission to access it. However, the geoip_country_code
variable seems not set.
I've tried many approaches to debug, like
add_header X-debug-message "$geoip_country_code";
or
log_format debug "$geoip_country_code"
for header, nginx returns empty result. And for log format, it simply record nothing. My bet is geoip_country_code is not even defined, so nginx cannot deal with it or what.
I tried to read the server error log, however, nothing there (nothing about geoip and the undefined variable). It's kinda annoying, how can I know what's going on with nginx and the geoip module?