Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: настройка доступа к сайту по GeoIP
- To: nginx-ru@xxxxxxxxx
- Subject: Re: настройка доступа к сайту по GeoIP
- From: "InventOR" <nginx-forum@xxxxxxxx>
- Date: Thu, 31 Jan 2013 05:27:58 -0500
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tigger.jlkhosting.com; s=x; h=Date:Sender:From:References:In-Reply-To:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=Z5O2+/SLpe18QxRALgatwzIph41pn6fi7YNZVYdE8Wg=; b=fC89KEu53g2oBd92Xfoh2hjLr9LjN2Axh2Ilz5p0pR3lIWKB5xe3rsWSdQemHFS+cnlp8IwTzjE40tgxKvWZQVccN5JBsiMyQMP3b4yVCBfQf/vjQENZ1r5TAAiViklF;
- In-reply-to: <510A3BDE.5020502@citrin.ru>
- References: <510A3BDE.5020502@citrin.ru>
в nginx.conf добавил:
#### GEOIP ADDON ############
geo $geo_wipmania {
include /usr/local/GeoIP/worldip.opera.conf;
include /usr/local/GeoIP/worldip.conf;
include /usr/local/GeoIP/worldip.added.conf;
default XX;
}
###############################
в любом месте хоста, где надо ограничить доступ по гео - ставлю
##################################################
# geo rewrite if country not RU, UA and unknown
if ($geo_wipmania !~ "^(RU|UA|XX)$") {
rewrite ^/(.*)$ http://1live.ru/notaccess.html last;
# return 416;
}
файлики можно взять на http://static.wipmania.com/static/worldip.cidr.zip
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,235765,235768#msg-235768
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|