cookie_limit_req_status
The `cookie_limit_req_status` directive sets the HTTP status code returned for requests that exceed the configured rate limits.
Description
The cookie_limit_req_status directive is part of the ngx_cookie_limit_req_module, which is used to manage the rate of requests that are associated with cookies. When a request is processed and more than the allowed rate of requests is detected, it can either be delayed or rejected based on the configurations set by other directives such as cookie_limit_req and cookie_limit_req_zone. The cookie_limit_req_status directive specifically defines the HTTP status code that will be returned to the client when a request is denied due to excessive cookie requests.
The directive takes a single argument, which is the HTTP status code to return, and accepts values within a standard HTTP status range. The default behavior without specifying this directive is to return a status code of 503. By customizing this value, administrators can provide more descriptive feedback to clients, such as 403 Forbidden or 429 Too Many Requests, depending on the context of their application and response strategy.
Config Example
cookie_limit_req_status 403;
Ensure the status code is within valid HTTP status code ranges (400-599).
Not specifying this directive will default to 503, which might not be appropriate for all applications.
Remember that status codes like 429 may require additional client-side handling for retries.