-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Description
We are leveraging rate limiting at the NGINX Ingress Controller level for our Kubernetes setup. Our goal is to include the following response headers so that clients can implement retry mechanisms based on rate limit values:
X-RateLimit-Limit
X-RateLimit-Remaining
X-RateLimit-Reset (if configured)
What we tried:
Added the above headers using configuration-snippet in the ingress annotation.
Applied the rate-limiting annotations (nginx.ingress.kubernetes.io/limit-req-*).
Hit the rate limit intentionally to verify headers.
Issue:
When the rate limit is exceeded, the response only includes default headers such as HTTP status code and Server and it do not show any custom headers. We expected these to reflect current limit, remaining requests, and reset time.
Questions:
Are there any official annotations or configuration options in Ingress-NGINX that support sending these X-RateLimit-* or retryafter headers automatically?
If not, is there a recommended way to dynamically populate these headers based on $limit_req variables?
Details
Ingress-NGINX version: v 4.12.2 [Helm chart]
Kubernetes version: v1.30.3
Metadata
Metadata
Assignees
Labels
Type
Projects
Status