# Unknown directive "geoip\_country"

**URL:** <https://www.ruby-forum.com/t/unknown-directive-geoip-country/244530>\
**Category:** NGINX\
**Created:** [April 27, 2016, 5:19pm UTC](https://www.ruby-forum.com/t/unknown-directive-geoip-country/244530 "2016-04-27T17:19:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [April 27, 2016, 5:19pm UTC](https://www.ruby-forum.com/t/unknown-directive-geoip-country/244530/1 "2016-04-27T17:19:22Z")

</div>

Hi,

I just upgraded nginx on my FreeBSD 10.3 server with the latest version  
provided by an up2date port tree, i.e. nginx/1.10.0.

This version seems to not recognize the directive geoip\_country anymore  
although it was compiled with the GeoIP module successfully.

Can someone advise ?

Thanks,  
a.

# uname -a

FreeBSD [icecube.pnzone.net](http://icecube.pnzone.net) 10.3-RELEASE FreeBSD 10.3-RELEASE #15  
r297699:  
Fri Apr 8 11:34:28 CEST 2016  
removed\_email\_address@domain.invalid:/usr/obj/usr/src/sys/ICE3K amd64

# nginx -V

nginx version: nginx/1.10.0  
built with OpenSSL 1.0.2g 1 Mar 2016  
TLS SNI support enabled  
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt=‘-I  
/usr/local/include’ --with-ld-opt=‘-L /usr/local/lib’  
–conf-path=/usr/local/etc/nginx/nginx.conf  
–modules-path=/usr/local/etc/nginx/modules  
–sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid  
–error-log-path=/var/log/nginx-error.log --user=www --group=www  
–with-ipv6  
–http-client-body-temp-path=/var/tmp/nginx/client\_body\_temp  
–http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\_temp  
–http-proxy-temp-path=/var/tmp/nginx/proxy\_temp  
–http-scgi-temp-path=/var/tmp/nginx/scgi\_temp  
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi\_temp  
–http-log-path=/var/log/nginx-access.log  
–with-http\_geoip\_module=dynamic  
–with-http\_slice\_module --with-http\_stub\_status\_module --with-pcre  
–with-http\_v2\_module --with-stream=dynamic --with-stream\_ssl\_module  
–with-http\_ssl\_module

# service nginx configtest

Performing sanity check on nginx configuration:  
nginx: [emerg] unknown directive “geoip\_country” in  
/usr/local/etc/nginx/conf.d/01\_pnzone\_SSL.conf:1  
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

# head -n1 /usr/local/etc/nginx/conf.d/01\_pnzone\_SSL.conf

geoip\_country /usr/local/share/GeoIP/GeoIPv6.dat;

Posted at Nginx Forum:

> **[unknown directive "geoip\_country"](https://forum.nginx.org/read.php?2,266453,266453#msg-266453)**
>
> Hi, I just upgraded nginx on my FreeBSD 10.3 server with the latest version provided by an up2date port tree, i.e. nginx/1.10.0. This version seems to not recognize the directive geoip\_country anymore although it was compiled with the GeoIP module...

---

<div class="post-metadata">

**Author:** ![apn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@apn](https://www.ruby-forum.com/u/apn)\
**Post date:** [April 28, 2016, 12:15am UTC](https://www.ruby-forum.com/t/unknown-directive-geoip-country/244530/2 "2016-04-28T00:15:53Z")

</div>

The FreeBSD port maintainer helped me directly and everything went back  
to  
normal after having added the following line at the top of the global  
Nginx  
conf file (nginx.conf):  
load\_module modules/ngx\_http\_geoip\_module.so;

Posted at Nginx Forum:

> **[Re: unknown directive "geoip\_country"](https://forum.nginx.org/read.php?2,266453,266470#msg-266470)**
>
> Hi, I just upgraded nginx on my FreeBSD 10.3 server with the latest version provided by an up2date port tree, i.e. nginx/1.10.0. This version seems to not recognize the directive geoip\_country anymore although it was compiled with the GeoIP module...
