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 agentsTelegram bot VPSPython or Node.js, always reachableDiscord bot VPSMusic, moderation, tickets: no downtimen8n 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 strategiesTrading bot VPSOpen-source crypto bots, protected API keys

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

Intelligence artificielle

Claude CodeL'agent de code d'Anthropic, dans votre terminalCodex CLIL'agent de code d'OpenAI en ligne de commandeOllamaDes modèles de langage locaux, sans API externeOpen WebUIUne interface de discussion pour vos modèles Ollama

Automatisation

n8nVos automatisations, sans limite d'exécutions

Déploiement et conteneurs

DockerLe moteur de conteneurs et Docker ComposeCoolifyDéployez vos applications depuis Git, sur votre serveurPortainerGérez vos conteneurs Docker depuis le navigateur

Supervision

Uptime KumaSurveillez vos sites et serveurs, alertes comprises

Network and security

WireGuardVotre propre VPN chiffré, rapide et moderneVaultwardenUn gestionnaire de mots de passe auto-hébergé

Sites et cloud

NextcloudVotre cloud de fichiers, agenda et contactsWordPressLe CMS le plus utilisé, sur une pile Nginx rapide

Jeux

PterodactylLe panel pour héberger vos serveurs de jeux
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

DNS

Cloudflare in front of a VPS: DNS, proxy and SSL done right

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

Cloudflare is very often used in front of a website hosted on a VPS: fast free DNS, a certificate, caching and web traffic filtering. But a rough configuration causes redirect loops, skews your logs and breaks game servers. This guide walks through the settings that matter.

1. Orange cloud or grey cloud

In Cloudflare's DNS tab, every A, AAAA or CNAME record has a toggle:

  • Grey cloud, "DNS only": Cloudflare simply answers with your VPS address. Visitors connect directly to the server.
  • Orange cloud, "Proxied": Cloudflare answers with its own addresses. Visitors connect to Cloudflare, which relays requests to your VPS. The server address is hidden, and Cloudflare's cache and web application firewall apply.

2. When to enable the proxy

Cloudflare's standard proxy only relays web traffic, HTTP and HTTPS, on a specific list of ports including 80, 443, 8080 and 8443. Nothing else gets through.

UseSetting
Website, API on port 443Orange possible
Game server: FiveM, Minecraft, RustGrey required
SSH, database, WireGuard VPNGrey required
Mail server (MX target)Grey required

A play.mysite.com record with the orange cloud does not work: players cannot connect, because Cloudflare does not accept their game traffic. To protect a game server you need network-level Anti-DDoS protection, not the web proxy.

3. The right SSL mode: Full (strict)

In SSL/TLS → Overview, Cloudflare offers several modes. Only one is both secure and free of pitfalls:

  • Flexible: encrypted between the visitor and Cloudflare, unencrypted between Cloudflare and your server. If your server itself redirects to HTTPS, you get an infinite redirect loop. Avoid it.
  • Full: encrypted end to end, but Cloudflare accepts any certificate on the server, even an expired one.
  • Full (strict): encrypted end to end with a valid certificate on the server. This is the mode to choose.

For the server certificate you have two options: a Let's Encrypt certificate obtained with Certbot, which also works behind the proxy (see Nginx and HTTPS), or a Cloudflare origin certificate, free and valid for up to 15 years, trusted only by Cloudflare, generated in SSL/TLS → Origin Server.

4. Get the real visitor address back

Behind the proxy, your server sees every request coming from Cloudflare addresses. Your logs, your statistics, Fail2ban and rate limiting become useless. Cloudflare passes the real address in the CF-Connecting-IP header: tell Nginx to trust it, only when the request comes from Cloudflare. Create /etc/nginx/conf.d/cloudflare.conf:

# IPv4 and IPv6 ranges published by Cloudflare at cloudflare.com/ips
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
# ... one line per published range ...
set_real_ip_from 2400:cb00::/32;
real_ip_header CF-Connecting-IP;

Copy the full, up-to-date list from Cloudflare's official IP ranges page; it rarely changes, but it does change. Then reload Nginx with nginx -t && systemctl reload nginx. If you use Fail2ban behind Cloudflare, note that a ban in the server firewall does not block a visitor coming through the proxy: see advanced Fail2ban.

5. Protect the origin address

The proxy only protects your server as long as its address stays unknown. It often leaks through:

  • a grey-cloud subdomain on the same server, such as ftp, mail or panel;
  • the headers of emails sent directly by the server;
  • DNS history: if the domain pointed to this server before the proxy was enabled, the old address is archived by public services.

To go all the way, only allow Cloudflare's address ranges on ports 80 and 443 in the server firewall. Any attempt to bypass the proxy is then refused. See configuring UFW.

6. Cache and rules

By default, Cloudflare caches static files (images, CSS, JavaScript) but not HTML. Two practical consequences:

  • After changing CSS or JavaScript, rename the file or add a version parameter, for example style.css?v=2, or purge the cache in the dashboard.
  • Never cache admin, account or cart pages. If you create cache rules for HTML, exclude them explicitly.

7. Cloudflare and the VPS Anti-DDoS protection

The two complement each other. Cloudflare protects the web traffic that goes through its proxy. The Anti-DDoS protection on our VPS filters all traffic reaching the server address, including game traffic, SSH and attacks aimed directly at the origin address. For a website, the two add up; for a game server, the network protection does the work. See limiting the impact of a DDoS attack.

Frequently asked questions

Why do I get a "too many redirects" error with Cloudflare?

Almost always because of the Flexible SSL mode: Cloudflare contacts your server over HTTP, the server redirects to HTTPS, and the loop starts again. Install a certificate on the server and switch the SSL mode to Full (strict).

Can a FiveM or Minecraft server sit behind Cloudflare?

Not with the standard proxy, which only relays web traffic. The game server's DNS record must be grey cloud, DNS only. To protect a game server against attacks, you need Anti-DDoS protection at the hosting provider's network level.

My Nginx logs only show Cloudflare addresses. How do I fix that?

Configure Nginx's real_ip module with the address ranges published by Cloudflare and the CF-Connecting-IP header, as in this guide. Nginx then replaces Cloudflare's address with the visitor's in the logs and for applications.

Let's Encrypt certificate or Cloudflare origin certificate?

The origin certificate is convenient, valid for up to 15 years with no renewal, but only Cloudflare trusts it: if you ever turn the proxy off, visitors will see an error. Let's Encrypt works in every case, at the cost of an automatic renewal.

Linux NVMe VPS

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