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.