Skip to content

AS213941 · Peering-20% on all VPS with code NVH20 · Delivered in 60 seconds

Linux VPSFrom €2.49/monthWindows VPSFrom €3.49/monthFiveM serverFrom €0.99/monthMinecraft serverFrom €1.99/month
VPS & Cloud

Ranges

Linux NVMe VPSRoot access, Debian, Ubuntu, Alma…Windows RDP VPSRemote desktop, licence includedDedicated serversIntel Xeon Gold, exclusive resourcesPterodactyl VPSGame panel preinstalled

Network and hosting

Anti-DDoSWeb hostingColocationIP transitVPN

Professionals

Reseller VPSReseller programme
Solutions

Bots and automation

AI agents VPSA server for your coding assistants and autonomous agentsOllama VPSYour private AI without a GPU, data in FranceTelegram bot VPSPython or Node.js, always reachableDiscord bot VPSMusic, moderation, tickets: no downtimeVinted bot VPSMonitor and Discord alerts 24/7n8n VPSWorkflows with no execution limitVPN VPSAn encrypted tunnel exiting in FranceWeb scraping VPSScheduled data collection, dedicated IP

Trading

Forex VPSYour robots manage positions overnightMetaTrader 4 VPSSeveral MT4 terminals on one machineMetaTrader 5 VPSForex, indices and stocks in MT5NinjaTrader VPSFutures and NinjaScript strategiesProp firm VPSChallenges and funded accounts, terminal always onlineAfrica trading VPSMetaTrader in Paris, from North or West AfricaRDP VPSWindows remote desktop, always onTrading bot VPSOpen-source crypto bots, protected API keys

Broker and prop firm VPS

FTMO VPSDedicated French IP, outside the USFundedNext VPSPrivate VPS for your EAsThe5ers VPSFixed IP, consistent locationIC Markets VPSWithout the 15 lots a month quotaPepperstone VPSMT4, MT5 and cTrader, fixed priceXM VPSNo $5,000 minimum balanceExness VPSSmall accounts welcome, 7 ms to London

Windows desktop

Windows 10 VPSFor software that requires Windows 10Windows 11 VPSA modern Windows desktop, reachable anywhereSEO VPSLarge-site crawls without tying up your PCStreaming VPSAn OBS studio streaming from the data centreWordPress VPSFast websites on NVMe disks
Marketplace

AI

OllamaLocal language models, with no external APIOpen WebUIA chat interface for your Ollama modelsAnythingLLMA private AI assistant for your documentsLangflowVisual editor for agents, RAG flows and AI APIsFlowiseBuild AI agents and chatbots visuallyQdrantVector database for RAG and semantic search

Trading

MetaTrader 5Official MT5 terminal, ready for your EAsMetaTrader 4Official MT4 terminal, ready for your EAsForex VPS pack (MT4 + MT5)MT4 and MT5 together, on a VPS tuned for tradingNinjaTrader 8NinjaTrader 8 with its prerequisitesFreqtradeOpen-source crypto trading bot, in simulation modeInteractive Brokers TWS / IB GatewayTWS or IB Gateway, official stable version

Bots and agents

Claude CodeAnthropic's coding agent, in your terminalCodex CLIOpenAI's command-line coding agentTelegram botYour Telegram bot, with automatic restartDiscord botYour Discord bot, with automatic restartOpenClawOpen-source personal AI assistant, active 24/7Hermes AgentAutonomous open-source AI agent

Deployment and automation

DockerThe container engine and Docker Composen8nYour automations, with no execution limitPortainerManage your Docker containers from your browserCoolifyDeploy your applications from Git, on your own serverUptime KumaMonitor your sites and servers, with alerts

Websites and databases

WordPressThe most widely used CMS, on a fast Nginx stackApache + PHP + MySQLApache, PHP and MariaDB, ready for your sitesMySQL (MariaDB)MySQL-compatible database serverPleskPlesk hosting panel, with your own licenceNextcloudYour own cloud for files, calendar and contacts

Network and security

WireGuardYour encrypted VPN, preinstalled free of chargeVaultwardenA self-hosted password manager

Game servers

FiveMFiveM server with txAdmin and MariaDB, ready to useMinecraftTurnkey Minecraft Java server, plugins and mods includedRustRust server with automatic updates and Oxide or CarbonCounter-Strike 2Dedicated Counter-Strike 2 server, installed for youPalworldDedicated Palworld server, installed for youValheimDedicated Valheim server, installed for you
Gaming

Game servers

FiveM servertxAdmin, ESX, QBCoreMinecraft serverJava, Bedrock, modpacksRust serverOxide, Carbon, wipesNova-Life serverNova-Life: Amboise RP

Protection and tools

FiveM Anti-DDoSFree tools
Resources

Learn

DocumentationBlog

Assistance

ContactSLA commitment
View plans Client area Peering · AS213941

Security

Advanced Fail2ban: protecting Nginx, WordPress and mail

By the NVHCloud team · 2026-09-18 · 4 min read

If you followed securing SSH, Fail2ban already protects your SSH access. But on a web server, bots mostly go after everything else: login forms, admin pages, forgotten configuration files. This guide extends Fail2ban to Nginx, WordPress and mail, and adds a long ban for those who keep coming back.

1. How Fail2ban decides

Fail2ban combines three elements in a jail:

  • a filter, a regular expression that recognises a malicious attempt in a log;
  • thresholds: maxretry attempts within a findtime window trigger a ban lasting bantime;
  • an action, usually a firewall rule that blocks the address.

Fail2ban ships dozens of ready-made filters in /etc/fail2ban/filter.d/. Never edit the provided .conf files: put your settings in .local files, which are not overwritten by updates.

2. A clean base with an allow-list

Start with /etc/fail2ban/jail.local:

[DEFAULT]
bantime   = 1h
findtime  = 10m
maxretry  = 5
banaction = ufw
ignoreip  = 127.0.0.1/8 ::1 YOUR_STATIC_IP

ignoreip is essential: add your office address or your monitoring server to it. Without it, a burst of legitimate connections, such as a deployment script reconnecting several times, can ban you from your own server.

3. The backend trap

Fail2ban reads either log files or the systemd journal. SSH writes to the systemd journal, especially on Debian 12, whereas Nginx writes to files. If you set backend = systemd in the [DEFAULT] section, the Nginx jails ignore their logpath and never see anything, without any error message. So set the backend per jail: systemd for SSH, auto for services that write to files, as in the examples below.

4. Protect Nginx

Add to jail.local:

[sshd]
enabled = true
backend = systemd
maxretry = 3
bantime  = 24h
[nginx-http-auth]
enabled = true
backend = auto
port    = http,https
logpath = /var/log/nginx/error.log
[nginx-botsearch]
enabled  = true
backend  = auto
port     = http,https
logpath  = /var/log/nginx/access.log
maxretry = 2
[nginx-limit-req]
enabled = true
backend = auto
port    = http,https
logpath = /var/log/nginx/error.log
maxretry = 10
  • nginx-http-auth bans repeated failures on areas protected by an Nginx password.
  • nginx-botsearch spots bots probing your site for admin pages and well-known scripts.
  • nginx-limit-req bans addresses that regularly exceed Nginx's request limit. It only works if you have configured a limit_req directive, described in limiting the impact of a DDoS attack.

5. Protect the WordPress login form

No WordPress filter is provided. Create /etc/fail2ban/filter.d/wordpress.conf:

[Definition]
failregex = ^<HOST> .* "POST /wp-login\.php
            ^<HOST> .* "POST /xmlrpc\.php
ignoreregex =

Then the matching jail:

[wordpress]
enabled  = true
backend  = auto
port     = http,https
filter   = wordpress
logpath  = /var/log/nginx/access.log
maxretry = 5
findtime = 10m
bantime  = 6h

A legitimate user submits the form once or twice; a bot, dozens of times. If you host several sites with separate logs, list them all on several lines in logpath. For configuring WordPress itself, see installing WordPress on a VPS.

6. Protect mail

If the server receives mail or authenticates users over SMTP:

[postfix]
enabled = true
backend = systemd
mode    = aggressive
[postfix-sasl]
enabled = true
backend = systemd
maxretry = 3

The aggressive mode also catches relay attempts and non-existent addresses. A server that only sends notifications does not need these jails: see configuring Postfix.

7. Punish repeat offenders

Many bots come back as soon as their ban ends. The recidive jail reads Fail2ban's own log and bans for a week any address banned several times in one day:

[recidive]
enabled  = true
backend  = auto
logpath  = /var/log/fail2ban.log
bantime  = 1w
findtime = 1d
maxretry = 3

8. Test a filter before enabling it

A filter that matches nothing protects nothing; a filter that is too broad bans your visitors. Test it on the real log:

fail2ban-regex /var/log/nginx/access.log /etc/fail2ban/filter.d/wordpress.conf

The command shows how many lines match. Then apply the configuration:

fail2ban-client -t && systemctl restart fail2ban
fail2ban-client status

The first command checks the syntax of the whole configuration; the last lists the active jails.

9. Manage bans

fail2ban-client status wordpress                  # addresses banned by one jail
fail2ban-client set wordpress unbanip 203.0.113.10 # unban an address
fail2ban-client get sshd ignoreip                 # show the allow-list
fail2ban-client banned                            # every banned address

If you banned yourself, connect from another connection, for example your phone's hotspot, or through the rescue console, then unban your address and add it to ignoreip.

Frequently asked questions

Can Fail2ban block my own visitors?

Yes, if a filter is too broad or a threshold too low. Test each filter with fail2ban-regex before enabling it, keep reasonable thresholds and add your static addresses to ignoreip. Also watch the number of banned addresses during the first few days.

Why does my Nginx jail never ban anyone?

Most often, backend = systemd is set in the DEFAULT section: the jail then reads the systemd journal instead of the file given in logpath, where Nginx writes. Set backend = auto on jails that read files, and check the filter with fail2ban-regex.

Does Fail2ban protect against a DDoS attack?

No. It acts on individual addresses that repeat attempts over seconds or minutes. A distributed attack comes from thousands of addresses and saturates the connection: it has to be filtered upstream, on the hosting provider's network.

How long should an address be banned?

An hour is enough for most bots, which move on to another target. Keep long bans for SSH and repeat offenders, with the recidive jail. Very long bans for everyone end up penalising legitimate users whose IP address has changed hands.

Linux NVMe VPS

Root access, Intel Xeon Gold and NVMe, delivered in 60 seconds. From €2.49/month.