• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Resolved Can't configure Fail2ban for Nginx Auth

Miguel Nunes

New Pleskian
I have a website which uses the authentication provided by the protected directory setting and I am using Nginx fully. There are no fail2ban jails for Nginx so I decided to create one.

This is what I did:

Created a Jail Filter named "nginx-auth":
Code:
[Definition]
failregex = no user/password was provided for basic authentication.*client: <HOST>
    user .* was not found in.*client: <HOST>
    user .* password mismatch.*client: <HOST>
ignoreregex = </host></host></host>

Then created the Jail and named it "nginx-auth":

Code:
[nginx-auth]
enabled = true
filter = nginx-auth
action = iptables-multiport[name="nginxauth", port="http,https", protocol="tcp"]
logpath = /var/www/vhosts/system/*/logs/error_log
/var/log/httpd/*error_log
maxretry = 3

I am looking for errors in the log with

Code:
# tail -f /var/www/vhosts/system/site.domain.tld/logs/error_log

But when the browser authentication pops up and I enter wrong login information, nothing happens. After 3 failed attempts, it's still going.

What could be wrong? I am not using Plesk's Firewall extension because my host has it's own firewall but Iptables is enabled.
 
It was the log path which was set to look for Apache's error logs instead of Nginx's.

Should be this:

Code:
/var/www/vhosts/system/*/logs/proxy_error_log
/var/log/nginx/*error.log
 
Back
Top