# 2010/09/06 17:19:31 1060#0: unknown directive "geoip\_country" in /usr/local/etc/nginx/nginx.conf:16

**URL:** <https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531>\
**Category:** NGINX\
**Created:** [September 6, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531 "2010-09-06T18:39:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 6, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531/1 "2010-09-06T18:39:34Z")

</div>

Hi,

I did compile in the geo\_ip module:  
(rproxy \<~\>) 0 # strings /usr/local/sbin/nginx |grep geo  
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  
–sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid  
–error-log-path=/var/log/nginx-error.log --user=www --group=www  
–http-client-body-temp-path=/var/tmp/nginx/client\_body\_temp  
–http-proxy-temp-path=/var/tmp/nginx/proxy\_temp  
–http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\_temp  
–http-log-path=/var/log/nginx-access.log --with-http\_geoip\_module  
–with-http\_ssl\_module --with-http\_stub\_status\_module --with-pcre  
…  
geoip\_city\_continent\_code  
geoip\_city\_country\_code  
geoip\_city\_country\_code3  
geoip\_city\_country\_name  
geoip\_region  
geoip\_city  
geoip\_postal\_code  
geoip\_latitude  
geoip\_longitude  
geoip\_country

but open restart, it throws the above error-msg in the error\_log.  
I use nginx 0.7.67 on FreeBSD7.

What could be the reason for this error?  
I don’t know if it actually works because the host is part of a  
CARP-setup  
and it’s the passive side (and I don’t want to failover to it just to  
try)

Best Regards,  
Rainer

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 6, 2010, 7:02pm UTC](https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531/2 "2010-09-06T19:02:59Z")

</div>

> Hi,

sorry, forget to include this:

this is the line in nginx.conf it complains about.

http {  
keepalive\_timeout 65;  
geoip\_country /usr/local/etc/geo/GeoIP.dat ;

Best Regards,  
Rainer

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 6, 2010, 7:46pm UTC](https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531/3 "2010-09-06T19:46:18Z")

</div>

Hello!

On Mon, Sep 06, 2010 at 06:38:28PM +0200, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I did compile in the geo\_ip module:  
> (rproxy \<~\>) 0 # strings /usr/local/sbin/nginx |grep geo  
> 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  
> –sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid  
> –error-log-path=/var/log/nginx-error.log --user=www --group=www  
> –http-client-body-temp-path=/var/tmp/nginx/client\_body\_temp  
> –http-proxy-temp-path=/var/tmp/nginx/proxy\_temp  
> –http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\_temp  
> –http-log-path=/var/log/nginx-access.log --with-http\_geoip\_module  
> –with-http\_ssl\_module --with-http\_stub\_status\_module --with-pcre  
> …  
> geoip\_city\_continent\_code  
> geoip\_city\_country\_code  
> geoip\_city\_country\_code3  
> geoip\_city\_country\_name  
> geoip\_region  
> geoip\_city  
> geoip\_postal\_code  
> geoip\_latitude  
> geoip\_longitude  
> geoip\_country
> 
> but open restart, it throws the above error-msg in the error\_log.  
> I use nginx 0.7.67 on FreeBSD7.

On _restart_ nginx will refuse to start with the above error  
message on terminal. As you see this in error\_log - probably you  
used _reload_ instead (i.e. re-read config for an already running  
binary). This error indicate that your loaded binary doesn’t have  
geoip module compiled in.

Follow binary upgrade procedure to upgrade running binary to one  
you have on disk. If you are using nginx from ports - just run  
“/usr/local/etc/rc.d/nginx upgrade”. Or, if you don’t care about  
several seconds of downtime, just restart nginx.

Maxim D.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 6, 2010, 9:51pm UTC](https://www.ruby-forum.com/t/2010-09-06-1731-1060-0-unknown-directive-geoip-country-in-usr-local-etc-nginx-nginx-conf-16/194531/4 "2010-09-06T21:51:35Z")

</div>

> Hello!

> Follow binary upgrade procedure to upgrade running binary to one  
> you have on disk. If you are using nginx from ports - just run  
> “/usr/local/etc/rc.d/nginx upgrade”. Or, if you don’t care about  
> several seconds of downtime, just restart nginx.

Hello,

thanks for your input.  
I did restart nginx on that server (it’s a CARP-slave).  
I’m really puzzled, because I used this server to build the package that  
works on the CARP-master…  
But then you got me thinking…  
I did a full stop and a clean start - et voila, it worked.  
On the CARP-master, I did an upgrade-procedure as per the book…

Thanks a lot!

Best Regards,  
Rainer
