demo: advanced rate limiting
a rate limit rule on /api/ratelimit-me: 10 requests per 10
seconds per source ip, with a 10 second mitigation
timeout. hit the button to fire 20 rapid requests. requests 11-20 come back as
429 from cloudflare's edge — the origin function never runs.
# hammer it (browser)
click "fire 20 requests" to start…
# hammer it (curl)
for i in $(seq 1 20); do
curl -s -o /dev/null -w "req %2d → %{http_code}\n" $i "https://rhocfsandbox.com/api/ratelimit-me"
done # what's the rule
| ruleset | zone → security → waf → rate limiting rules |
| rule name | SITE_ratelimit_hammer |
| characteristic | source ip |
| threshold | 10 requests / 10 seconds |
| mitigation timeout | 10 seconds |
| action | block · custom html response (429) |