ingress-nginx: Fix duplicate limit_req_status directive.
The controller template already emits limit_req_status, so setting it
in http-snippet made every reload fail ("directive is duplicate").
Use the limit-req-status-code config key instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I75b988d0f5f5c4340cec768d83f6f0507da310e3
diff --git a/ingress-nginx/config.yaml b/ingress-nginx/config.yaml
index 918186d..cf78fef 100644
--- a/ingress-nginx/config.yaml
+++ b/ingress-nginx/config.yaml
@@ -16,6 +16,10 @@
data:
proxy-buffer-size: "64k"
+ # The controller template already emits limit_req_status; setting it again
+ # in http-snippet makes every reload fail with a duplicate-directive error.
+ limit-req-status-code: "429"
+
# Rate-limit crawlers per bot family (not per IP, since they rotate IPs).
# Requests with an empty $bot_key (i.e., everyone else) are not limited.
http-snippet: |
@@ -34,7 +38,6 @@
~*(DataForSeoBot|MJ12bot|DotBot|Reflect) seo-misc;
}
limit_req_zone $bot_key zone=bots:10m rate=10r/m;
- limit_req_status 429;
server-snippet: |
limit_req zone=bots burst=20 nodelay;