Forum: NGINX GeoIP module questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ezra Z. (Guest)
on 2007-09-25 22:03
(Received via mailing list)
Hey there nginxers-

  Is there a way to use a geoip database with nginx instead of
explicitely listing out all the IP ranges in the nginx.conf?
Something like this:

http://www.maxmind.com/app/country

  There is a modeul for apache and lighttpd for this type of stuff.
Any hints or help here? Or shoudl I just script something up to auto
generate the geoip config for nginx from one of these databases?

Thanks!

-- Ezra Z.
-- Founder & Ruby Hacker
-- removed_email_address@domain.invalid
-- Engine Y., Serious Rails Hosting
-- (866) 518-YARD (9273)
proforg (Guest)
on 2007-09-25 23:31
(Received via mailing list)
http://wiki.codemongers.com/NginxHttpGeoModule

+ contrib/geo2nginx.pl to convert MaxMind CSV database.

ex:

geo $IP_GEO

{
  default  --;
         include /etc/nginx/geo_ip_country;
}

and proxy_set_header / fastcgi_param as usual


On 25.09.2007, at 23:52, Ezra Z. wrote:

> auto generate the geoip config for nginx from one of these databases?
>
>

Aleksej Besciokov
removed_email_address@domain.invalid
+7 495 7853149
Maxim D. (Guest)
on 2007-09-25 23:32
(Received via mailing list)
Hello!

On Tue, 25 Sep 2007, Ezra Z. wrote:

> geoip config for nginx from one of these databases?
Hint 1:
You may use contrib/geo2nginx.pl script to convert maxmind's geoip
database into nginx config format.

Hint 2:
You may use "include" directive to include additional file into
nginx.conf
(e.g. your converted geoip database).

Maxim D.
3988ceb035c3465f590af8862cf3a6f6?d=identicon&s=25 Joe R. (Guest)
on 2008-01-25 12:28
quick, dumb follow up question on this...

what is the syntax for running geo2nginx.pl?

tried ./geo2nginx.pl GeoIPCountryWhois.csv geo.conf

and

./geo2nginx.pl GeoIPCountryWhois.csv > geo.conf

to no avail.

the script looks quite simple, and i tried to RTFM i.e look at the
script, but there's no usage example, and it doesn't look like there's
any switches.

i tried hunting around for some similar examples, no luck.

im sure this is really simple, considering there isn't even a usage
example, but im not very bright.. i mean not a coder or perl guy...
could somebody help a brother  out on this one

thanks in advance
Igor C. (Guest)
on 2008-01-25 12:49
(Received via mailing list)
perl geo2nginx.pl < GeoIPCountryWhois.csv > geo.conf
3988ceb035c3465f590af8862cf3a6f6?d=identicon&s=25 Joe R. (Guest)
on 2008-01-25 15:04
awesome, thanks!
This topic is locked and can not be replied to.