Welcome! Log In Create A New Profile

Advanced

Re: nginx limit_rate if in location - strange behaviour - possible bug ?

Maxim Dounin
October 09, 2013 11:48AM
Hello!

On Wed, Oct 09, 2013 at 05:21:51PM +0300, Bozhidara Marinchovska wrote:

[...]

> I'm using limit_rate case if in location. Regarding documentation
> "if in location" context is avaiable.
>
> My configuration is as follows:
>
> location some_extension {
>
> # case 1
> if match_something {
> root ...
> break;
> }
>
> # case 2
> if match_another {
> root ...
> break;
> }
>
> # else (case3)
> root ...
> something other ...
> here it is placed also limit_rate / limit_after directives
> }
>
> There is a root inside location with a (strong) reason :) (nginx
> pitfails case "root inside location block - BAD").
>
> When I open in my browser http://my.website.com/myfile.ext it
> matches case 3 from the cofiguration. Limit_rate/limit_after works
> correct as expected.
> I want case1 not to have limit_rate / limit_after.

The limit_rate directive is somewhat special (== wierd), and a
limit once applied on a location matched is preserved for future
use. Further matches with different limit_rate set doesn't
influence the limit actually used.

If you want to override limit_rate on a specific condition, use

set $limit_rate <rate>;

instead, see http://nginx.org/r/limit_rate.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx limit_rate if in location - strange behaviour - possible bug ?

Bozhidara Marinchovska October 09, 2013 10:24AM

Re: nginx limit_rate if in location - strange behaviour - possible bug ?

Bozhidara Marinchovska October 09, 2013 10:42AM

Re: nginx limit_rate if in location - strange behaviour - possible bug ?

Bozhidara Marinchovska February 17, 2014 05:04AM

Re: nginx limit_rate if in location - strange behaviour - possible bug ?

Jonathan Matthews February 17, 2014 05:12AM

Re: nginx limit_rate if in location - strange behaviour - possible bug ?

Maxim Dounin October 09, 2013 11:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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