[PATCH] Added additional parameter "r/h" (requests per hour)

aspel at ukr.net aspel at ukr.net
Wed Dec 27 10:45:45 UTC 2017


# HG changeset patch
# User aspel <aspel at ukr.net>
# Date 1514370676 0
#      Wed Dec 27 10:31:16 2017 +0000
# Node ID a24cb7e952ae4db04e133fa8f3ad7b51703e03d5
# Parent  32dd4fc94fba998762aaec65652ad8d554052fc8
Added additional parameter "r/h" (requests per hour)


This additional parameter will help protect a server from brute-force.

In which thousands of IP addresses participate.


diff -r 32dd4fc94fba -r a24cb7e952ae src/http/modules/ngx_http_limit_req_module.c
--- a/src/http/modules/ngx_http_limit_req_module.c Tue Dec 26 19:01:12 2017 +0300
+++ b/src/http/modules/ngx_http_limit_req_module.c Wed Dec 27 10:31:16 2017 +0000
@@ -801,6 +801,10 @@
            } 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);

Add to Phrasebook 
No wordlists for English -> Russian... 
Create a new wordlist... Copy Add to Phrasebook 
No wordlists for English -> Russian... 
Create a new wordlist... Copy Add to Phrasebook 
No wordlists for English -> Russian... 
Create a new wordlist... Copy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20171227/973293ab/attachment.html>


More information about the nginx-devel mailing list