HTTP limit req directives

limit_req_zone directive

http only; defines a named rate state zone. sync is commercial. Empty keys are excluded. The optional sync flag is commercial-only; variable rate is documented for commercial 1.31.3 and is not part of local OSS 1.26.3 syntax.

Formal Syntax & Structure

nginx syntaxnginx
limit_req_zone key zone=name:size rate=rate [sync];

Parameters & Attributes

NameTypeDescription
keyexpressionIdentify the rate bucket; an empty evaluated key is excluded. Use a trustworthy identity.
zonezone=name:sizeName and allocate shared state across local workers.
raterate=number r/s or r/m (no space)Set sustained request processing rate; use a fixed rate for the OSS baseline.
syncliteral sync (commercial only)Optional cross-instance state synchronization; requires supported commercial deployment.

Working Example

Example Snippetnginx
limit_req_zone $binary_remote_addr zone=search_rate:1m rate=2r/s;
Nginx Reference