limit_rate_after does not work inside location block

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

limit_rate_after does not work inside location block

j94305
Hi,

I have a location block

location ~ /get_file$ {
            limit_rate_after 500m;
            limit_rate 1m;
...
...
}

The limit_rate_after does not work when put inside the location block, if I
move it right above the location line i.e. inside server block, it works.

Any idea on how to make it work inside location and if block.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285895,285895#msg-285895

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: limit_rate_after does not work inside location block

Maxim Dounin
Hello!

On Wed, Oct 16, 2019 at 05:21:41AM -0400, [hidden email] wrote:

> I have a location block
>
> location ~ /get_file$ {
>             limit_rate_after 500m;
>             limit_rate 1m;
> ...
> ...
> }
>
> The limit_rate_after does not work when put inside the location block, if I
> move it right above the location line i.e. inside server block, it works.
>
> Any idea on how to make it work inside location and if block.

It does work, as long as the response is returned within the location
in question.  If it doesn't work, likely the response is returned
elsewhere.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: limit_rate_after does not work inside location block

j94305
Got it. You are right, response is returned by another block via
X-Accel-Redirect.

Thankyou!

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285895,285901#msg-285901

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx