Welcome! Log In Create A New Profile

Advanced

Re: Country banning

APseudoUtopia
August 29, 2009 11:49AM
On Sat, Aug 29, 2009 at 11:41 AM, Jim Ohlstein<jim@ohlste.in> wrote:
> We're dealing with a high degree of fraud from certain countries and would
> like to simply ban all IP's from those countries.
>
> I seem to recall reading here that using the Geo module is more efficient
> for this purpose than the GeoIP module.
>
> Currently I have the following in nginx.conf:
>
> geo $country {
>   include geo.conf;
> }
>
> where geo.conf is generated from MaxMind country lite csv database using
> geo2nginx.pl supplied with nginx.
>
> In the site config I have multiple if statements like:
>
> server {
>   ...
>
>   if ($country = XX) {
>       return 403;
>   }
>
>   if ($country = YY) {
>       return 403;
>   }
>
>   if ($country = ZZ) {
>       return 403;
>   }
>
> ...
>
> }
>
> Is this more efficient than using GeoIP module? Is there a more efficient
> way of doing this?
>
> Jim
>
>
>
>

It'd probably be more efficient to do this through a firewall...ipfw
or pf on unix, or iptables on linux. There are several sites that keep
lists of IP block allocations to countries. A good example is
http://www.countryipblocks.net/. This would definitely be more
efficient than looking up every IP in a GeoIP database.
Subject Author Posted

Country banning

Jim Ohlstein August 29, 2009 11:41AM

Re: Country banning

APseudoUtopia August 29, 2009 11:49AM

Re: Country banning

Chris Zimmerman August 29, 2009 12:11PM

Re: Country banning

Igor Sysoev August 29, 2009 12:27PM

Re: Country banning

Igor Sysoev August 29, 2009 01:09PM

Re: Country banning

Jim Ohlstein August 29, 2009 01:58PM

Re: Country banning

Igor Sysoev August 29, 2009 02:20PM

Re: Country banning

Jim Ohlstein August 29, 2009 05:25PM

Re: Country banning

Igor Sysoev August 30, 2009 01:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready