vim /etc/fail2ban/jail.d/nginx.conf
[nginx-bad-request]
enabled = true
filter = nginx-bad-request
[nginx-botsearch]
enabled = true
filter = nginx-botsearch
[nginx-404]
enabled = true
port = http,https
filter = nginx-404
logpath = /var/log/nginx/access.log
maxretry = 300
[nginx-http-auth]
enabled = true
port = http,https
filter = nginx-http-auth
logpath = /var/log/nginx/error.log
[nginx-botsearch]
enabled = true
port = http,https
filter = nginx-botsearch
logpath = /var/log/nginx/access.log
maxretry = 50