Nginx – Can I specify rate in limit_req_zone in requests per hour

nginxrate-limitingweb-server

While limiting the number of requests from an IP, I am using

limit_req_zone  $binary_remote_addr zone=one:10m rate=1r/m;

I can specify the rate in r/m (requests per minute) or r/s (requests per second). Is there a way to specify the rate in requests/hour ?

For example, I want the rate to be 75 requests/hour. So it will be 1.25r/m, but r/m has to be an integer. So, even that way it doesn't work.

Please help me out.

Best Answer

According to the documentation you can specify in requests per second or requests per minute, not requests per hour, so no it's not possible.

The rate is specified in requests per second (r/s). If a rate of
less than one request per second is desired, it is specified in
request per minute (r/m). For example, half-request per second
is 30r/m.

I suggest you round up or round down, according to your use case. 1r/s is 60 requests per minute, 2r/s is 120 requests per minute.