Support article
How to Use Cloudflare CDN with Your Hosting
Connect Cloudflare CDN to your hosting to speed up your website: create account, change DNS, enable SSL and configure cache and performance.
Introduction
Cloudflare is one of the most popular CDN networks in the world. By connecting it to your hosting, your website loads faster, is more protected against attacks and gains availability. Best of all: the basic plan is free.
In this article you’ll see what Cloudflare is, what advantages it has, and how to connect it to your hosting step by step.
What a CDN is and how it works
A CDN (Content Delivery Network) is a network of servers distributed around the world. Instead of serving your website from a single server (your host’s), the CDN keeps copies of your files on many servers. When a visitor enters, they receive the website from the server closest to them.
Example
- Your hosting is in Spain.
- A visitor enters from Mexico.
- Without CDN, the website is served from Spain: there’s latency due to distance.
- With CDN, the website is served from a server in Mexico: the visitor notices the website is faster.
[Imagen sugerida: diagram of how a CDN serves a website from the nearest server]
The CDN doesn’t replace your hosting. They work together: hosting hosts your website and the CDN distributes it worldwide.
Advantages of using Cloudflare
- Greater speed. Serves content from the server closest to the visitor.
- Protection against attacks. Blocks malicious traffic before it reaches your hosting.
- Additional cache. Keeps copies of your website and reduces server load.
- Free SSL. Adds HTTPS at no cost.
- Greater availability. If your hosting goes down temporarily, Cloudflare can keep serving the cached version.
- Traffic analytics. Shows you visit data and threats.
How to connect Cloudflare to your hosting
Step 1: Create a Cloudflare account
- Go to cloudflare.com and register (free).
- Click Add a Site.
- Type your domain (for example
mydomain.com). - Select the Free plan and click Continue.
Step 2: Cloudflare scans your DNS
Cloudflare reads your domain’s current DNS records and imports them automatically. Check that everything is correct (you should see your A, MX, CNAME records, etc.).
[Imagen sugerida: screenshot of DNS import in Cloudflare]
Step 3: Change your domain’s nameservers
Cloudflare will assign you two of its own nameservers, for example:
linda.ns.cloudflare.com
matt.ns.cloudflare.com
Now you have to change your domain’s nameservers:
- Log in to the panel where your domain is registered (at miHosting, you can do it from the client area).
- Find the nameservers or name servers option.
- Replace the current ones with Cloudflare’s.
- Save the changes.
Nameserver change propagation takes between a few minutes and 24 hours. Cloudflare will notify you by email when it’s active.
Step 4: Configure SSL
Once Cloudflare is active:
- Log in to the Cloudflare panel.
- Go to SSL/TLS.
- Select Full or Full (strict) mode if your hosting already has SSL installed.
If your hosting doesn’t have SSL, use Flexible mode. But the ideal is to have SSL on both sides (hosting and Cloudflare) and use Full (strict).
Step 5: Enable performance improvements
In the Cloudflare panel, go to Speed and Caching and enable:
- Auto Minify for CSS, JS and HTML.
- Brotli compression.
- Always Online (serves cached version if your hosting goes down).
[Imagen sugerida: screenshot of Cloudflare optimization options]
Cloudflare SSL modes
| Mode | What it does | Recommended |
|---|---|---|
| Off | No SSL (not recommended) | No |
| Flexible | Cloudflare uses HTTPS, but traffic between Cloudflare and your hosting isn’t encrypted | Only if your hosting has no SSL |
| Full | SSL on both sides, but without verifying certificate | Better than Flexible |
| Full (strict) | Verified SSL on both sides | ✅ The most secure and recommended |
To use Full (strict), your hosting must have a valid SSL certificate. At miHosting all plans include free Let’s Encrypt SSL.
Useful tips
- Configure SSL in Full (strict) mode. It’s the most secure. Make sure you have SSL on your hosting.
- Purge cache after major changes. If you make a change to your website and don’t see it, it may be Cloudflare’s cache. Go to Caching → Purge Everything.
- Don’t mix caches. If you use Cloudflare and a WordPress cache plugin, make sure they don’t conflict. LiteSpeed Cache and Cloudflare are compatible.
- Enable “Always Online”. If your hosting goes down, Cloudflare serves a cached version.
- Review analytics. Cloudflare gives you traffic and blocked threats data for free.
Common problems
I changed nameservers and the website doesn’t load
Propagation takes between minutes and 24 hours. If after 24 hours it doesn’t work, check that the nameservers are correctly set at the domain registrar.
My website goes into a redirect loop after enabling Cloudflare
It’s the classic ERR_TOO_MANY_REDIRECTS error. Usually happens when Cloudflare is in Flexible mode and your hosting forces HTTPS. Solution: change Cloudflare to Full or Full (strict).
Email stops working
When changing nameservers, MX records may be lost. Make sure Cloudflare imported your MX records correctly during setup.
I don’t see the changes I make to the website
It’s Cloudflare’s cache. Go to Caching → Configuration → Purge Everything and try again.
My WordPress panel is locked out
Cloudflare may block panel access. Add an exception in Page Rules or Configuration Rules for the yourdomain.com/wp-admin* URL.
Frequently asked questions
Is Cloudflare free?
Yes, the basic plan is free and sufficient for most websites. There are paid plans with more features.
Does Cloudflare replace my hosting?
No. Cloudflare is an additional layer. Your hosting remains where your website is hosted.
Do I need Cloudflare if my hosting is already fast?
It’s not mandatory, but it helps especially with visitors far from your server. If your hosting is in Spain and you receive visits from Latin America, Cloudflare improves their experience.
Can I use Cloudflare with any hosting?
Yes, with practically any hosting. You just need to be able to change the domain’s nameservers.
Are Cloudflare and LiteSpeed Cache compatible?
Yes. LiteSpeed Cache manages cache on your hosting; Cloudflare manages it on its servers. They work well together.
Speed up your website with Cloudflare
Cloudflare is one of the simplest and free ways to speed up your website and protect it. Connecting it to your hosting takes a few minutes and the benefit is immediate: more speed, more security and more availability.
If you need help configuring Cloudflare with your miHosting hosting, open a ticket and our technicians will guide you step by step. And remember: at miHosting we use LiteSpeed and NVMe SSD, so your website starts from a very fast base; Cloudflare takes it even further for distant visitors.