4
4
479112020-08-18 18:35:55
Nginx
47911, 2020-08-18 18:35:55

Nginx: limit_conn_zone and limit_req_zone working?

Amazing nearby.

I added the following to the nginx config:

limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_req_zone $binary_remote_addr zone=one:10m rate=20r/m;

Before:
include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;


And in the site config (there: include /etc/nginx/sites-enabled/*;):
location @php_ZAnyCK {
limit_conn addr 3;
limit_req zone=one burst=2 nodelay;
        try_files $uri =404;
        fastcgi_pass $_PHP_COKET;
    }


Actually somtryu for a day: from one ip 146105, in fact: how is this possible?

I understand these entries as: from one IP to any site (all sites) can go no more than 3 times at the same time and send no more than 20 requests per minute. Actually: how did "146105" come from one persistent IP? Of course, it can be blocked, but that's not the point.

And I previously (a day before this experiment) set:
location / {
limit_conn addr 3;
limit_req zone=one burst=2 nodelay;
        ...
    }

And nothing has changed. What's the matter? (Right now, restrictions in the PHP section)

Nginx version (1.19.2). I heard it doesn't work for some.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
47911, 2020-08-25
@47911

Apparently everything was fine with them.
The base loaded all 32 processor cores. Therefore, he began to sin on "attendance".
====
In general. The problem was in the operative (one of the 16 dice was buggy).
https://debianforum.ru/index.php/topic,16064.0.htm...
edac-util -v
And a little more: in IPMI there are logs in which such info comes out if something goes wrong. Actually - they took it out and everything is in order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question