Nginx-Logo

FreeBSD Upgrade to Nginx 1.10.1 Unknown directive “geoip_country” Dynamic Modules

Posted on Posted in FreeBSD, IOCage, Nginx

I recently decided it was time to migrate my UFS ezjails based Digital Ocean droplet to the new and sparkly FreeBSD 10.3 ZFS droplet whilst transitioning to iocage. To make my life harder I thought it was a prime opportunity to build everything from scratch rather than tar the jails as per these instructions.

Everything was going well until I tried to start Nginx.

$ 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:38
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

After “googling” and the finaly checking  freshport I found this commit. As of Nginx 1.9.11 release modules are now loaded dynamically. For more reading see the Nignx website

Having found where the module resided

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

I made the following change to my nginx.conf and everything fired back in to life.

#user  nobody;
worker_processes  2;
### Load Modules###
load_module "/usr/local/libexec/nginx/ngx_http_geoip_module.so";

Leave a Reply

Your email address will not be published. Required fields are marked *