...
location /search/ {
limit_req zone=one burst=5;
}
Directives
Syntax:语法 | limit_req |
---|---|
Default: 默认 | — |
Context:内容(作用范围) | http , server , location |
Sets the shared memory zone and the maximum burst size of requests. If the requests rate exceeds the rate configured for a zone, their processing is delayed such that requests are processed at a defined rate. Excessive requests are delayed until their number exceeds the maximum burst size in which case the request is terminated with an error. By default, the maximum burst size is equal to zero. For example, the directives
设置共享内存区域和请求的最大突发大小。如果请求速率超过了区域配置的速率,则会延迟其处理,以便以定义的速率处理该请求。过多的请求将被延迟,直到其数量超过最大突发大小为止,在这种情况下,该请求将因错误而终止 。默认情况下,最大突发大小等于零。例如,指令
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
server {
location /search/ {
limit_req zone=one burst=5;
}