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
Add custom block response to host_uri_rate_limit_rules
Optional per-rule block_response_code (e.g. 429), block_retry_after_seconds
(Retry-After header), and block_response_body_json (APPLICATION_JSON body via
a keyed WebACL custom_response_body). Defaults keep the plain 403 block, so
existing rules are unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
uri_paths =optional(list(string), []) # URI path(s) to scope the rate limit to. With REGEX these are regex patterns. Empty (default) rate-limits the whole host.
96
96
uri_match_type =optional(string, "STARTS_WITH") # How to match uri_paths: EXACTLY (pin one endpoint), STARTS_WITH (prefix), or REGEX (for variable segments, e.g. "^/api/v1/users/[^/]+/validation$"). REGEX is case-sensitive (URL-decoded, not lowercased); use an inline (?i) flag for case-insensitivity.
97
97
count_override =optional(bool, false) # If true, override the action to `count` (dry run). If false (default), the action is `block` when the limit is exceeded.
98
+
99
+
# Optional custom block response (only applied when the action is `block`, i.e. count_override = false).
100
+
block_response_code =optional(number) # HTTP status returned to blocked clients, e.g. 429. Null (default) => WAF's default 403. Setting this is what enables the custom response.
101
+
block_retry_after_seconds =optional(number) # If set (requires block_response_code), adds a `Retry-After: <n>` response header.
102
+
block_response_body_json =optional(string) # If set (requires block_response_code), returns this string as an APPLICATION_JSON body (<= 4096 bytes).
0 commit comments