An additional thing one can add is to block any connection that is not HTTP/2.0. Many bots still only use HTTP/1.1 or lower. I just drop with 444 but others may wish to give a friendly terse error message using 403.
if ($server_protocol != HTTP/2.0) { return 444; }
Here's another one that will block most non-browsers (except for headless chrome of course) if ($http_sec_fetch_mode !~ (cors|no-cors|navigate) ) { return 444; }
These should be tested extensively on a non revenue impacting site.Another bot-blocking method is to drop any TCP SYN packets with an MSS outside of a sensible range. Here is an example using netfilter on IPv4 in the "raw" table (to keep them out of the CPU impacting state table):
-A PREROUTING -i eth0 -p tcp -m tcp -d {your_wan_ip} --syn -m tcpmss ! --mss 1220:1460 -j DROP