<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi Francis.<br><br>Thanks very much.<br>I tried to use map, but it doesn't work. Below is the settings.<br><br> map $arg_mod $forum_limit {<br> default $binary_remote_addr;<br> image '';<br> }<br> limit_conn_zone $forum_limit zone=addr:128m;<br> limit_req_zone $forum_limit zone=refresh:128m rate=3r/s;<br><br>server {<br> location ~*^/(home|forum|portal).php$ {<br> root /web/www;<br> limit_conn addr 5;<br> limit_req zone=refresh burst=5 nodelay;<br> fastcgi_pass unix:/tmp/nginx.socket;<br> fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;<br> include fastcgi_params;<br> }<br> location ~ \.php$ {<br> root /web/www;<br> fastcgi_pass unix:/tmp/nginx.socket;<br> fastcgi_index index.php;<br> fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;<br> include fastcgi_params;<br> }<br> }<br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>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
</pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>