Welcome! Log In Create A New Profile

Advanced

Re: exception for NGINX limit_req_zone

Francis Daly
July 20, 2012 06:40PM
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
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: 129
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