My issue:
I’m trying to rate limit requests to my server that result on 404 errors because I’ve got some malicious crawlers crashing my database trying to find wordpress endpoints, accesible git repositories and some other typical endpoints which do not exist on my site, but require a db check due to the dynamic nature of my app.
How I encountered the problem:
I’ve tried to follow the documentation in order to add rate limiting into 404 pages but I haven’t been able to make it work. For some reason it seems the rate limiter module does not run for errors. As you can see on the playground snippet below, $limit_req_status
doesn’t even get populated. I couldn’t find anything on the docs that would explain this.
Solutions I’ve tried:
https://tech-playground.com/snippet/thankful-scorpion-of-success/
Any help will be greatly appreciated because I’ve been trying to do this for a while already.