http://recchiaa3blv62iesz7qqrqabp4o3c3pv557cjz6r5vdarudusoiozqd.onion/server/fail2ban.shtml
First, it enables fail2ban for ssh, then tells fail2ban that we're using sshd, so it can look for the logs in the usual places. The ban action is to simply add rules to our ip tables list. Every IP gets 3 tries and after a fail, -1 means they're banned indefinitely.
3. Enable fail2ban for nginx by adding the following to the [nginx-http-auth] block [nginx-http-auth]
enabled = true
filter = nginx-http-auth 4.