Hi,
I have this configuration for rate limiting in HAproxy. I want to ensure that if a user hits the rate limit, their IP will be blocked for 5 minutes. Currently, in this configuration, if a user sends 200 requests in 10 seconds, they will reach the rate limit, but their IP will not be blocked. How can I modify it so that their IP gets blocked for 5 minutes when they reach the rate limit?
frontend front_api
bind *:80
timeout client 30s
redirect scheme https if !{ ssl_fc }
http-request set-header X-Forwarded-Proto https if { ssl_fc }
mode http
stick-table type ip size 1m expire 24h store http_req_rate(10s)
tcp-request connection track-sc1 src
http-request track-sc0 src table front_api
acl exempt_ip src 10.0.0.19 10.0.0.4
acl rate_limited src_http_req_rate(front_api) ge 200
use_backend blocked_ips if rate_limited !exempt_ip
backend blocked_ips
mode http
http-request deny deny_status 429
timeout client 300s