http-limit-traffic-rate #
Nginx directive limit_rate could limit connection's speed, and limit_conn could limit connection number by given variable. If the client is a browser, it only open one connection to the server. The speed will be limited to limit_rate, unless the client is a multi-thread download tool.
Source: upstream source
Directives
limit_traffic_rate #
syntax: limit_traffic_rate 2 args; · context: http, server, location
limit_traffic_rate module ========================= Notes ----- Nginx directive limit_rate could limit connection's speed, and limit_conn could limit connection number by given variable.
limit_traffic_rate_zone #
syntax: limit_traffic_rate_zone 3 args; · context: http
Defines a shared memory zone that tracks download rates keyed by a given variable for later rate-limiting enforcement.
Example
http {
#limit_traffic_rate_zone rate $request_uri 32m;
limit_traffic_rate_zone rate $remote_addr 32m;
server {
location /download/ {
limit_traffic_rate rate 20k;
}
}
}