Nginx geoip redirect based on country codes but exclude googlebot

st1905 nginx-forum at
Wed Nov 17 15:55:36 MSK 2010


I want to redirect people to specific pages on a website according to
their country but i dont want to redirect googlebot or other spiders,
how can i do this with nginx ?

I have done redirection with php earlier but havent been able to exclude

As i read from maxmind website, on apache its done like this

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

# Redirect one country
RewriteEngine on
RewriteRule ^(.*)$$1 [L]

# Redirect multiple countries to a single page
RewriteEngine on
RewriteRule ^(.*)$$1 [L]

It still does not have any info to remove googlebot from redirection.

Thanks for any help.

Posted at Nginx Forum:,151401,151401#msg-151401

More information about the nginx mailing list