diff --git a/support/proxy/http.d/ratelimit.conf b/support/proxy/http.d/ratelimit.conf index 2d1dd46a..9d3908b1 100644 --- a/support/proxy/http.d/ratelimit.conf +++ b/support/proxy/http.d/ratelimit.conf @@ -1,5 +1,15 @@ -limit_req_zone $binary_remote_addr zone=ip:10m rate=5r/s; -limit_req zone=ip burst=50 delay=10; +limit_req_zone $binary_remote_addr zone=read_zone:10m rate=20r/s; +limit_req zone=read_zone burst=400 delay=40; + +# Only limit writes +map $request_method $write_limit { + OPTIONS ''; + HEAD ''; + GET ''; + default $binary_remote_addr; +} +limit_req_zone $write_limit zone=write_zone:10m rate=5r/s; +limit_req zone=write_zone burst=50 delay=10; # Use 429 (Too Many Requests) for rate limit responses limit_req_status 429;