After hard google search i couldn't find good information how to limit rate with nginx and debian.
I'm not sure where should i add that filter nginx.conf or default. I added this to default not sure if it's right:
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
server {
server_name Realesta74.net;
location / {
limit_req zone=one burst=5;
}
}
Is that fine? And also how to test it?
Nginx rate limiting is implemented identically regardless of Linux distribution (Debian, Ubuntu, etc). Nginx officially provides a good tutorial and explaination:
https://www.nginx.com/blog/rate-limiting-nginx/
Testing can be done with multiple-connection URL tools like Siege or Apache Benchmark Tool, and Siege this example uses 30 simultaneous connections to test rate limiting on a web page. 503 responses would show if rate limiting is configured properly:
$ siege -c 30 -r 1 --no-parser https://www.example.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With