Welcome! Log In Create A New Profile

Advanced

Re:Re: exception for NGINX limit_req_zone

fhal
July 20, 2012 10:28PM
Hi Francis.

Thanks very much.
I tried to use map, but it doesn't work. Below is the settings.

map $arg_mod $forum_limit {
default $binary_remote_addr;
image '';
}
limit_conn_zone $forum_limit zone=addr:128m;
limit_req_zone $forum_limit zone=refresh:128m rate=3r/s;

server {
location ~*^/(home|forum|portal).php$ {
root /web/www;
limit_conn addr 5;
limit_req zone=refresh burst=5 nodelay;
fastcgi_pass unix:/tmp/nginx.socket;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.php$ {
root /web/www;
fastcgi_pass unix:/tmp/nginx.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}





At 2012-07-21 06:38:49,"Francis Daly" <francis@daoine.org> wrote:
>On Fri, Jul 20, 2012 at 09:48:04PM +0800, fhal wrote:
>
>Hi there,
>
>> I got a problem with NGINX limit_req_zone. Anyone can help? The problem is that, I want to limit user access to some specific URL, for example:
>>
>> /forum.php?mod=forumdisplay?
>> /forum.php?mod=viewthread&***
>>
>> But, I do want to add an exception for below URL,
>>
>> /forum.php?mod=image&*
>
>For nginx "location" matches, these three are all the same, and are all
>exactly "/forum.php". The "location" goes from the first / to just before
>the first ? or #.
>
>That is why your configuration is not doing what you want.
>
>> location ~*^/(home|forum|portal).php$ {
>> root /web/www;
>> limit_conn addr 5;
>> limit_req zone=refresh burst=5 nodelay;
>> fastcgi_pass unix:/tmp/nginx.socket;
>> fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
>> include fastcgi_params;
>> }
>
>I do not know what the solution is, but I expect it will involve doing
>something different based on the value of $arg_mod, within that location
>block.
>
>How is limit_req_zone zone=refresh defined? Would using "map" to set
>the relevant $variable to empty if $arg_mod is "image" be appropriate?
>
>Good luck with it,
>
> f
>--
>Francis Daly francis@daoine.org
>
>_______________________________________________
>nginx mailing list
>nginx@nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

exception for NGINX limit_req_zone

fhal July 20, 2012 09:50AM

Re: exception for NGINX limit_req_zone

Francis Daly July 20, 2012 06:40PM

Re:Re: exception for NGINX limit_req_zone

fhal July 20, 2012 10:28PM

Re: Re: exception for NGINX limit_req_zone

Francis Daly July 21, 2012 04:10PM

Re:Re: Re: exception for NGINX limit_req_zone

fhal July 22, 2012 11:06AM

Re: Re: Re: exception for NGINX limit_req_zone

Francis Daly July 22, 2012 02:36PM

Re:Re: Re: Re: exception for NGINX limit_req_zone

fhal July 23, 2012 09:26PM

Re: Re: Re: Re: exception for NGINX limit_req_zone

Francis Daly July 24, 2012 05:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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