Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Firstly, thanks for the article, exactly what I needed!
The following line in nginx-http-auth.conf causes problems for me when I use basic_auth:
^ [error] \d+#\d+: *\d+ no user/password was provided for basic authentication, client: <HOST>, server: \S+, request: “\S+ \S+ HTTP/\d+.\d+”, host: “\S+”\s*$
Before I’ve even entered my username and password, nginx logs a “no user/password was provided for basic authentication” error.
I had to remove that line from nginx-http-auth.conf, because my IP got banned a few times before I realised what was going on.
What if I am using cloudflare? The IP address will be always the same. Is this a problem?
Could you explain this line “If you do not use PHP or any other language in conjunction with your web server, you can add this jail to ban those who request these types of resources.” ?
Hey,
My email notifications are sending From: root@localhost with name root.
I am after this (as per my /etc/fail2ban/jail.local): sendername = Fail2Ban-Alert sender = fail2ban@localhost
setup postfix as per here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04
any help
Great article!
FYI, another way to test your rules would be to use the fail2ban-regex command, like this:
fail2ban-regex /path/to/log/logname.log /etc/fail2ban/filter.d/nameoffilter.conf regex_to_ignore (just google fail2ban-regex for more info on that)
Confusingly, I’m getting results that look like this (nginx Ubuntu server):
Use ignoreregex line : regex_to_ignore Use failregex file : /etc/fail2ban/filter.d/nginx-noscript.conf Use single line : /var/log/nginx/access.log
Failregex: 0 total
Ignoreregex: 0 total
Date template hits:
Lines: 1 lines, 0 ignored, 0 matched, 1 missed |- Missed line(s): | /var/log/nginx/access.log
…Would this not suggest that the regex is not finding anything when it should be (i.e. not working)? Also, I get “Missed line(s): /var/log/nginx/access.log” on all the filters from this tutorial
Many thanks for this great article! I can’t find any information about what is exactly noproxy? Fail2ban already blocked several Chinese IP’s because of this attempt, and I lowered to maxretry 0 and ban for one week. What are they trying to achieve and do with my server? I also added a deny rule in nginx conf to deny the Chinese IP and a GeoIP restriction, but I still have these noproxy bans.
Hey,
I am having an issue with Fail2Ban and nginx-http-auth.conf filter.
For some reason filter is not picking up failed attempts:
root@user-name:~# fail2ban-regex /var/log/nginx/22222.error.log /etc/fail2ban/filter.d/nginx-http-auth.conf
Running tests
=============
Use failregex file : /etc/fail2ban/filter.d/nginx-http-auth.conf
Use log file : /var/log/nginx/22222.error.log
Results
=======
Failregex: 0 total
Ignoreregex: 0 total
Date template hits:
|- [# of hits] date format
| [4] Year/Month/Day Hour:Minute:Second
`-
Lines: 4 lines, 0 ignored, 0 matched, 4 missed
|- Missed line(s):
| 2016/08/24 13:13:59 [error] 725#725: *255 user "test" was not found in "/etc/nginx/htpasswd-ee", client: 123.123.123.0, server: , request: "GET / HTTP/2.0", host: "456.456.456.0:22222"
| 2016/08/24 13:14:03 [error] 725#725: *255 user "test2" was not found in "/etc/nginx/htpasswd-ee", client: 123.123.123.0, server: , request: "GET / HTTP/2.0", host: "456.456.456.0:22222"
| 2016/08/24 13:14:07 [error] 725#725: *255 user "test3" was not found in "/etc/nginx/htpasswd-ee", client: 123.123.123.0, server: , request: "GET / HTTP/2.0", host: "456.456.456.0:22222"
| 2016/08/24 13:14:11 [error] 725#725: *255 user "test4" was not found in "/etc/nginx/htpasswd-ee", client: 123.123.123.0, server: , request: "GET / HTTP/2.0", host: "456.456.456.0:22222"
Any ideas?
Here is my filter:
[Definition]
failregex = ^ \[error\] \d+#\d+: \*\d+ user "\S+":? (password mismatch|was not found in ".*"), client: <HOST>, server: \S+, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"\s*$
^ \[error\] \d+#\d+: \*\d+ no user/password was provided for basic authentication, client: <HOST>, server: \S+, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"\s*$
When i used this command: sudo iptables -S some Ip’s also showed in the end, what does that means? I’m a newbie. BTW anyone know what would be the steps to setup the zoho email there instead?
Forgot to mention, i googled those Ip’s they was all from china, are those the attackers who are inside my server? I’ve been victim of attackers, what would be the steps to kick them out?