Welcome! Log In Create A New Profile

Advanced

Properly setup of limit_req

Posted by intelbg 
Properly setup of limit_req
January 28, 2016 09:01AM
Hello, first of all I would like to mention that I read many items on the forum and outsite it, but I still can't completely understand the way this module work and that's the reason why I ask you here and thank you in advance if you help me.

1. I want to limit requests to vhosts per IP so if one Ip flood the vhost, the other visitors ot be ok and not banned. From my tests until now this not happens. Whe other ip flood the vhost I can't open the vhost's site too. This happens with the following configuration:

limit_req_zone $binary_remote_addr zone=perip:10m rate=100r/s;
limit_req zone=perip burst=100 nodelay;

How can I limit the vhost per ip so the other visitors to not have a problem? Also i would like to have another restriction that will limit the requests to vhosts not per ip, but for example 200 requests to one vhost from all visitors,another 200 requests limit to other vhost and so on.

2. I can't understand if burst limit and req_zone limit must be the same value? I want to set limit 200 requests from ip for example and on the 201 requests the ip to be denied with 503? Does the module can work on this way and how can I achieve this? One value to req_zone, but other to burst or what?

3. Why every next time I run apache bench mark the failed requests number is different, but not equal as the server limit is not changed in nginx?
Re: Properly setup of limit_req
February 01, 2016 07:12AM
Can anybody answer these questions, please? If I didn't explain something right please tell me.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready