Add rate limit per hour "r/h"

Add the opportunity to apply rate limit by hour.
This commit is contained in:
batmanfr 2025-02-24 17:30:16 +01:00 committed by GitHub
parent d25139db01
commit 67b26d8238
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);