Welcome! Log In Create A New Profile

Advanced

limit_req is not working in virutal location?

pva
January 11, 2018 03:32AM
Hi. Could you, please, explain why limit_req in @limitspeed location is not working in case of redirect to @allowed virtual location and works in case I copy @allowed virtual location contents inside @limitspeed?

================= This configuration is not limiting speed at all ========================
location @allowed {
root /store/;
try_files /live$uri @localdvr;
}

location @limitspeed {
limit_req zone=limit_req_rate;
limit_rate 2500000;
error_page 420 = @allowed;
return 420;
}

location ~ ^/limit_speed_for_ts/.*\.ts {
proxy_intercept_errors on;
recursive_error_pages on;
error_page 418 = @limitspeed;
error_page 419 = @allowed;
# we allow all requests with if there is token argument without limiting speed
if ($arg_token = "") {
return 418;
}
return 419;
}
============================================

But if I change @limitspeed it will work:

location @limitspeed {
limit_req zone=limit_req_rate;
limit_rate 2500000;
root /store/;
try_files /live$uri @localdvr;
}


Why?

Thanks in advance for any hints.
Subject Author Posted

limit_req is not working in virutal location?

pva January 11, 2018 03:32AM

Re: limit_req is not working in virutal location?

Francis Daly January 11, 2018 08:14AM

Re: limit_req is not working in virutal location?

pva January 11, 2018 10:47AM

Re: limit_req is not working in virutal location?

Maxim Dounin January 11, 2018 10:58AM

Re: limit_req is not working in virutal location?

pva January 11, 2018 12:22PM

Re: limit_req is not working in virutal location?

Maxim Dounin January 11, 2018 01:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready