Loading the GeoIP Module with nginx 1.10.0 on FreeBSD

After upgrading to nginx 1.10.0 on my FreeBSD machines, I found that nginx would no longer start.

$ sudo /usr/local/etc/rc.d/nginx restart
Performing sanity check on nginx configuration:
nginx: [emerg] unknown directive "geoip_country" in /usr/local/etc/nginx/nginx.conf:42
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

Looking at the commit logs led me to revision 414084, which notes that the GeoIP module and several other modules are now built as dynamic modules.

So I looked for where the GeoIP module was installed.

$ pkg info -l nginx | fgrep geoip
        /usr/local/libexec/nginx/ngx_http_geoip_module.so

And updated the configuration to load the GeoIP module dynamically.

load_module "/usr/local/libexec/nginx/ngx_http_geoip_module.so";

Additional reading:

Benjamin Lee

Benjamin Lee

Ben co-founded Instics and writes about system administration.

‹ Latest entries