From 67b26d8238883bbb55b60748c26040c99a4d474f Mon Sep 17 00:00:00 2001 From: batmanfr Date: Mon, 24 Feb 2025 17:30:16 +0100 Subject: [PATCH] Add rate limit per hour "r/h" Add the opportunity to apply rate limit by hour. --- src/http/modules/ngx_http_limit_req_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c index 2b062a305..14f49c07d 100644 --- a/src/http/modules/ngx_http_limit_req_module.c +++ b/src/http/modules/ngx_http_limit_req_module.c @@ -912,6 +912,10 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } else if (ngx_strncmp(p, "r/m", 3) == 0) { scale = 60; len -= 3; + + } else if (ngx_strncmp(p, "r/h", 3) == 0) { + scale = 3600; + len -= 3; } rate = ngx_atoi(value[i].data + 5, len - 5);