Answer the question
In order to leave comments, you need to log in
Map question in Nginx?
All my users are on HTTP/2, a couple of percent of old devices are on HTTP/1.1 + bots on it.
And on HTTP/1.0 one guano climbs.
The idea to slow down all the wickedness that goes over HTTP/1.0, I try like this:
map $server_protocol $limit {
"HTTP/1.0" $binary_remote_addr;
default "";
}
limit_req_zone $limit zone=bot:10m rate=1r/m;
I add this to the server
limit_req zone=bot burst=2;
As a result, in the logs I see that different animals make more than 1 request per minute from one IP using the HTTP / 1.0 protocol.
Where is the mistake?
Answer the question
In order to leave comments, you need to log in
tried like this
map $server_protocol $limit {
default 0;
"HTTP/1.0" 1;
}
limit_req_zone $limit zone=bot:10m rate=1r/m;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question