NGINX — how to make a large black list?

Hello. Found on one of the projects unpleasant moments, and you want to block obvious violators. The fact that IP can add as blocking. How will the map behave with, for example, 20 IPS? Or is there a more elegant solution? Thank you.
July 8th 19 at 12:19
1 answer
July 8th 19 at 12:21
Solution
65K elements in geomap - garbage.

Somewhere in the 100k should have to think about what you are doing wrong.
Vlad, not the geomap, but simply an array map (ngx_http_map_module) - misael commented on July 8th 19 at 12:24
: nginx.org/ru/docs/http/ngx_http_geo_module.html

http_map not needed here, and inside there is the same.
With Marie, the only difference is there of the regular season, they can slow down the whole thing. - eldon_Batz84 commented on July 8th 19 at 12:27
: the deny will not work because I need non-standard header to take the ip. pastebin.com/rr3t9gUX there is not the regular season, will be fine? Or, as advised by the guys in the comments, refer to fail2ban and give him a sheet with these ip? - misael commented on July 8th 19 at 12:30
: read the link, eh?

"Describes for the variable dependence of the values from the IP address of the client. By default, the address is taken from the $remote_addr variable, but it can also be obtained from another variable (0.7.27), for example:"

For massive addresses in nginx geo use, it's fast. Point. - eldon_Batz84 commented on July 8th 19 at 12:33
: thank you pointed, did not understand at first thought - misael commented on July 8th 19 at 12:36

Find more questions by tags Nginx