Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Limit 404 with req_limit

$
0
0
Some clients try a large amount of non existing urls to test for vulnerability (phpmyadmin, …). I try to limit the requests with the following (non working) code in the http section:

map $status $zone {
404 $binary_remote_addr;
default "";
# or 200 "";
}

limit_req_zone $zone zone=errors:10m rate=10r/m;
limit_req zone=errors nodelay;

any ideas how I can do this, and block any requests (even with non 404 status code) for some time from these ips?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>