You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Option Limit Rate is enabled, it does not include Retry-After header in 429 or 503 response found in RFC7231.
Solution
There is variable $status that holds response status value. You could use map directive to define another variable that holds retry delay and use add_header directive.
add_header Retry-After $retry_after always;
add_header will not send header if value (second argument) is empty. And we need always flag, otherwise it will not set header for 429 status code.
Information
https://www.whatismybrowser.com/w/CSS2S8F
Help request
Problem
When Option Limit Rate is enabled, it does not include Retry-After header in 429 or 503 response found in RFC7231.
Solution
There is variable
$status
that holds response status value. You could usemap
directive to define another variable that holds retry delay and useadd_header
directive.add_header
will not send header if value (second argument) is empty. And we needalways
flag, otherwise it will not set header for 429 status code.Full example:
Source
Stackoverflow - NGINX add Retry-After header to ONLY 429 Responses
The text was updated successfully, but these errors were encountered: