Welcome! Log In Create A New Profile

Advanced

Re: Country / CIDR banning

Jim Ohlstein
August 02, 2009 10:58PM
Shri @ DevLib.Org wrote:
> We've been getting an extraordinary amount of spam from a few IP
> ranges (hosting proxies) and countries (Nigeria for example) on our
> classifieds section.
>
> Mod Geo_IP
> =============
> http {
> geoip_country /usr/local/share/max/GeoIP.dat;
> ......
> =============
> and the result would be in $geoip_country_code
>
> *How would I ban based on this result ... for the whole server?*

server {
if ($geoip_country_code = NG) {
return 403;
}
...
}
> * *
>
> Banning by CIDR
> In Apache a simple Deny from CIDR would work in the Directory / section.
>
> *How can I do this in Nginx?*
>
> Thanks!
>
> Shri
>
Jim
Subject Author Posted

Country / CIDR banning

Shri @ DevLib.Org August 02, 2009 09:58PM

Re: Country / CIDR banning

Jim Ohlstein August 02, 2009 10:58PM

Re: Country / CIDR banning

Igor Sysoev August 03, 2009 01:13AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 228
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