ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ngx http limit req module и реально е применение


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: ngx http limit req module и реально е применение
  • From: "vagner" <nginx-forum@xxxxxxxx>
  • Date: Mon, 18 Jul 2011 05:27:10 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Date:Sender:From:References:In-Reply-To:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=6iQ3pqagm4OEZnrv8xCPs253L1F/KGtfZL5aNY3rXYE=; b=APx34d+Ds9BrnYxDCrxbRQy1cRdP30N19P8sdih6xaTPUCHiwdf6Q3DS2ZEly7NkLrpjvWbn3afwH1OC1yDOzIqQ5WitlCS/k16M0J+pa5oHIRFATp30ijeX2sCv+efg;
  • In-reply-to: <20110717173959.GK1137@xxxxxxxxxx>
  • References: <20110717173959.GK1137@xxxxxxxxxx>

Сделал так:
http {
(...)
geo $white{
default 0;
include /etc/white;
}

geo $black{
default 0;
include /etc/black;
}
limit_req_zone $binary_remote_addr zone=beta:10m rate=1r/s;

server {
(...)
error_page 418 = @php_limit;
 
location ~ \.php$ {
                if ($black) {
                return 418;
                }
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  
/home/hg/repos/hg.books.ilovexq.ru/pages$fastcgi_script_name;
                include fastcgi_params;
        }
location php_limit {
                limit_req zone=black nodelay;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  
/home/hg/repos/hg.books.ilovexq.ru/pages$fastcgi_script_name;
                include fastcgi_params;
        }
}

Это срабатывает, но только для $black
отдает 500 код:(

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,212493,212524#msg-212524


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.