I've inplemented something based on https://community.centminmod.com/threads/blocking-bad-or-aggressive-bots.6433/ Works perfectly fine for me. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,271483,271535#msg-271535