{"id":5029,"date":"2025-03-05T12:59:04","date_gmt":"2025-03-05T17:59:04","guid":{"rendered":"https:\/\/underhost.com\/blog\/?p=5029"},"modified":"2026-10-23T08:52:33","modified_gmt":"2026-10-23T12:52:33","slug":"the-best-way-to-use-cloudflare-with-cpanel-whm-for-better-performance","status":"publish","type":"post","link":"https:\/\/underhost.com\/blog\/the-best-way-to-use-cloudflare-with-cpanel-whm-for-better-performance\/","title":{"rendered":"How to Use Cloudflare with cPanel &#038; WHM: DNS, SSL, Real IPs and Caching"},"content":{"rendered":"<div class=\"uh-blog-hero\" style=\"margin:0 0 40px;text-align:center;padding:48px 24px;border-radius:20px;background:linear-gradient(135deg,#0D1F3C 0%,#125A8A 58%,#176EA5 100%);color:#ffffff;box-shadow:0 20px 40px -15px rgba(13,31,60,0.28);position:relative;overflow:hidden;\">\n<div style=\"display:inline-flex;align-items:center;gap:8px;padding:7px 14px;margin-bottom:16px;border:1px solid rgba(0,212,255,0.32);border-radius:999px;color:#DFF8FF;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:rgba(0,212,255,0.10);\"><i class=\"fas fa-sliders-h\" style=\"color:#00D4FF;\"><\/i> Control Panels<\/div>\n<h1 style=\"color:#ffffff;font-size:clamp(32px,5vw,46px);line-height:1.12;margin:0 0 14px;font-weight:800;\">How to Use Cloudflare with cPanel &amp; WHM: DNS, SSL, Real IPs and Caching<\/h1>\n<p style=\"font-size:18px;color:#EAF6FF;max-width:800px;margin:0 auto;line-height:1.7;\">Enhance website speed, security, and reliability by integrating Cloudflare with cPanel &amp; WHM.<\/p>\n<\/div>\n<div class=\"uh-blog-excerpt\" style=\"border-left:4px solid #00D4FF;padding:18px 20px;margin:0 0 34px;background:#F8FAFC;color:#1F2937;border-radius:0 14px 14px 0;box-shadow:0 8px 28px rgba(13,31,60,0.08);line-height:1.75;\"><strong style=\"color:#0D1F3C;\">Short answer:<\/strong> Add your domain to Cloudflare and change the nameservers. Proxy only the website records, and set mail, FTP and cPanel hostnames to <strong>DNS only<\/strong>. Keep AutoSSL on the server and set Cloudflare&#8217;s SSL mode to <strong>Full (strict)<\/strong>. On the server, set up <code>mod_remoteip<\/code> so logs, cPHulk and your applications see real visitor IP addresses, and make sure your firewall never blocks Cloudflare&#8217;s IP ranges. Then add Cache Rules for static files, and for HTML only if you exclude logged-in, cart and admin pages.<\/div>\n<nav aria-label=\"Table of contents\" class=\"uh-toc\" style=\"background:#ffffff;border:1px solid #E5E7EB;border-radius:16px;padding:20px 22px;margin:0 0 34px;box-shadow:0 4px 12px rgba(13,31,60,0.08);\">\n<div style=\"font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#176EA5;margin-bottom:10px;\"><i class=\"fas fa-list\" style=\"color:#00D4FF;\"><\/i> In this guide<\/div>\n<ol style=\"margin:0;padding-left:20px;columns:2 260px;column-gap:28px;line-height:1.9;\">\n<li><a href=\"#what-cloudflare-adds-to-a-cpanel-site\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">What Cloudflare adds to a cPanel site<\/a><\/li>\n<li><a href=\"#step-1-add-the-domain-and-check-the-dns-records\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 1: add the domain and check the DNS records<\/a><\/li>\n<li><a href=\"#step-2-set-up-ssl-correctly\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 2: set up SSL correctly<\/a><\/li>\n<li><a href=\"#step-3-restore-real-visitor-ip-addresses\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 3: restore real visitor IP addresses<\/a><\/li>\n<li><a href=\"#step-4-keep-the-firewall-from-blocking-cloudflar\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 4: keep the firewall from blocking Cloudflare<\/a><\/li>\n<li><a href=\"#step-5-set-up-caching\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 5: set up caching<\/a><\/li>\n<li><a href=\"#step-6-security-settings-worth-turning-on\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Step 6: security settings worth turning on<\/a><\/li>\n<li><a href=\"#troubleshooting\" style=\"color:#176EA5;text-decoration:none;font-weight:600;\">Troubleshooting<\/a><\/li>\n<\/ol>\n<\/nav>\n<div class=\"uh-post-content\" style=\"color:#1F2937;font-size:16px;line-height:1.75;\">\n<h2 id=\"what-cloudflare-adds-to-a-cpanel-site\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-info-circle\" style=\"color:#00D4FF;\"><\/i> What Cloudflare adds to a cPanel site<\/h2>\n<ul style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\"><strong>Faster static files:<\/strong> images, CSS and JavaScript are served from Cloudflare locations near your visitors.<\/li>\n<li style=\"margin:0 0 8px;\"><strong>Less load on the server:<\/strong> cached files no longer reach Apache or PHP.<\/li>\n<li style=\"margin:0 0 8px;\"><strong>Protection:<\/strong> DDoS protection, bot controls and firewall rules in front of the server.<\/li>\n<li style=\"margin:0 0 8px;\"><strong>Free certificates at the edge<\/strong>, in addition to the certificate on your server.<\/li>\n<\/ul>\n<p style=\"margin:0 0 18px;\">Cloudflare does not replace server security, updates or backups. It is a layer in front of the server.<\/p>\n<h2 id=\"step-1-add-the-domain-and-check-the-dns-records\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-globe\" style=\"color:#00D4FF;\"><\/i> Step 1: add the domain and check the DNS records<\/h2>\n<ol style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Create a Cloudflare account and add your domain. Cloudflare imports the existing DNS records.<\/li>\n<li style=\"margin:0 0 8px;\">Compare the imported records with the DNS zone in cPanel (<strong>Domains &gt; Zone Editor<\/strong>). Add anything that is missing.<\/li>\n<li style=\"margin:0 0 8px;\">Change the nameservers at your domain registrar to the two Cloudflare nameservers.<\/li>\n<\/ol>\n<div style=\"overflow-x:auto;margin:26px 0;border:1px solid #E5E7EB;border-radius:14px;-webkit-overflow-scrolling:touch;\">\n<table style=\"width:100%;border-collapse:collapse;background:#ffffff;color:#1F2937;font-size:15px;line-height:1.55;margin:0;min-width:600px;\">\n<thead>\n<tr style=\"background:#0D1F3C;color:#fff;\">\n<th style=\"padding:14px;text-align:left;\">Record<\/th>\n<th style=\"padding:14px;text-align:left;\">Proxy status<\/th>\n<th style=\"padding:14px;text-align:left;\">Why<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">example.com and www<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Proxied (orange cloud)<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Website traffic goes through Cloudflare.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">mail, MX targets<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">DNS only (grey cloud)<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Cloudflare&#8217;s proxy carries web traffic only, so email must go straight to the server.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">ftp<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">DNS only<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">FTP cannot pass through the proxy.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">cpanel, webmail, whm<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">DNS only<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Control panel ports such as 2083 and 2087 work most reliably directly.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">The server hostname<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">DNS only<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Used for SSL on services and for mail.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"margin:0 0 18px;\">After the change, DNS is managed at Cloudflare, so future DNS changes must be made there, not in cPanel.<\/p>\n<h2 id=\"step-2-set-up-ssl-correctly\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-terminal\" style=\"color:#00D4FF;\"><\/i> Step 2: set up SSL correctly<\/h2>\n<ol style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Keep <strong>AutoSSL<\/strong> enabled on the server, so the site has a valid certificate. See our <a href=\"https:\/\/underhost.com\/blog\/free-ssl-install-lets-encrypt-cpanel-centos-servers\/\">free SSL guide<\/a>.<\/li>\n<li style=\"margin:0 0 8px;\">In Cloudflare, open <strong>SSL\/TLS &gt; Overview<\/strong> and choose <strong>Full (strict)<\/strong>.<\/li>\n<li style=\"margin:0 0 8px;\">Turn on <strong>Always Use HTTPS<\/strong> in <strong>SSL\/TLS &gt; Edge Certificates<\/strong>.<\/li>\n<\/ol>\n<div style=\"background:#FFF7ED;border:1px solid #FDBA74;border-radius:16px;padding:20px 22px;margin:24px 0;\">\n<h3 style=\"margin:0 0 10px;color:#9A3412;font-size:20px;\"><i class=\"fas fa-exclamation-triangle\" style=\"color:#F97316;\"><\/i> Avoid Flexible mode:<\/h3>\n<p style=\"margin:0;color:#7C2D12;line-height:1.7;\">Flexible sends traffic to your server over plain HTTP. If the site also redirects to HTTPS, visitors get an endless redirect loop, and data between Cloudflare and the server is not encrypted.<\/p>\n<\/div>\n<h2 id=\"step-3-restore-real-visitor-ip-addresses\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-database\" style=\"color:#00D4FF;\"><\/i> Step 3: restore real visitor IP addresses<\/h2>\n<p style=\"margin:0 0 18px;\">Behind Cloudflare, every request seems to come from a Cloudflare IP address. That breaks access logs, cPHulk, login limits and the IP checks in your applications. Apache&#8217;s <code>mod_remoteip<\/code> fixes this.<\/p>\n<ol style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">In WHM, open <strong>EasyApache 4<\/strong>, customise the current profile, and install <code>mod_remoteip<\/code>.<\/li>\n<li style=\"margin:0 0 8px;\">Open <strong>Service Configuration &gt; Apache Configuration &gt; Include Editor<\/strong> and edit the <strong>Pre Main Include<\/strong> for all versions.<\/li>\n<li style=\"margin:0 0 8px;\">Add the lines below, with every range from Cloudflare&#8217;s published lists at cloudflare.com\/ips. The two ranges shown are only examples.<\/li>\n<\/ol>\n<pre style=\"background:#0D1F3C;color:#EAF6FF;padding:18px 20px;border-radius:14px;overflow-x:auto;line-height:1.7;font-size:15px;\"><code>RemoteIPHeader CF-Connecting-IP\nRemoteIPTrustedProxy 173.245.48.0\/20\nRemoteIPTrustedProxy 103.21.244.0\/22\n# ...add every IPv4 and IPv6 range from cloudflare.com\/ips-v4 and cloudflare.com\/ips-v6<\/code><\/pre>\n<p style=\"margin:0 0 18px;\">Save and restart Apache. Cloudflare adds ranges from time to time, so check the list every few months.<\/p>\n<h2 id=\"step-4-keep-the-firewall-from-blocking-cloudflar\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-shield-alt\" style=\"color:#00D4FF;\"><\/i> Step 4: keep the firewall from blocking Cloudflare<\/h2>\n<p style=\"margin:0 0 18px;\">If your firewall blocks a Cloudflare IP address, every visitor routed through that Cloudflare location loses access. Add Cloudflare&#8217;s ranges to the allow list. With CSF, add each range to <code>\/etc\/csf\/csf.allow<\/code> and run <code>csf -r<\/code>. See our <a href=\"https:\/\/underhost.com\/blog\/how-to-install-and-configure-csf-firewall-on-your-server\/\">CSF firewall guide<\/a>. Block abusive visitors in Cloudflare&#8217;s security rules instead, where the real IP address is known.<\/p>\n<h2 id=\"step-5-set-up-caching\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-terminal\" style=\"color:#00D4FF;\"><\/i> Step 5: set up caching<\/h2>\n<p style=\"margin:0 0 18px;\">By default, Cloudflare caches static files such as images, CSS and JavaScript, but not HTML pages. That default is safe for every site. To cache HTML as well, create a Cache Rule in <strong>Caching &gt; Cache Rules<\/strong>:<\/p>\n<ul style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\">Set cache eligibility to <strong>Eligible for cache<\/strong> for your public pages.<\/li>\n<li style=\"margin:0 0 8px;\">Add a separate rule that <strong>bypasses<\/strong> the cache for <code>\/wp-admin<\/code>, <code>\/wp-login.php<\/code>, <code>\/cart<\/code>, <code>\/checkout<\/code>, <code>\/my-account<\/code>, and any request with a login or cart cookie.<\/li>\n<li style=\"margin:0 0 8px;\">Set an <strong>Edge TTL<\/strong>, for example a few hours, so updates appear without manual purges.<\/li>\n<\/ul>\n<p style=\"margin:0 0 18px;\">Test while logged in and logged out, and place a test order on stores, before you rely on HTML caching. Purge the cache in <strong>Caching &gt; Configuration<\/strong> after large changes.<\/p>\n<h2 id=\"step-6-security-settings-worth-turning-on\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-shield-alt\" style=\"color:#00D4FF;\"><\/i> Step 6: security settings worth turning on<\/h2>\n<ul style=\"list-style:none;padding-left:0;\">\n<li style=\"margin:0 0 8px;\">\u2713 The free managed WAF rules in <strong>Security<\/strong>, plus the full managed rulesets on paid plans.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 Bot Fight Mode, if bots load your site. Test it, because it can block legitimate tools and API clients.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 A rate limiting rule for <code>\/wp-login.php<\/code> or other login pages.<\/li>\n<li style=\"margin:0 0 8px;\">\u2713 Under Attack Mode only during an attack. It adds a browser check for every visitor.<\/li>\n<\/ul>\n<h2 id=\"troubleshooting\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-exclamation-triangle\" style=\"color:#00D4FF;\"><\/i> Troubleshooting<\/h2>\n<div style=\"overflow-x:auto;margin:26px 0;border:1px solid #E5E7EB;border-radius:14px;-webkit-overflow-scrolling:touch;\">\n<table style=\"width:100%;border-collapse:collapse;background:#ffffff;color:#1F2937;font-size:15px;line-height:1.55;margin:0;min-width:600px;\">\n<thead>\n<tr style=\"background:#0D1F3C;color:#fff;\">\n<th style=\"padding:14px;text-align:left;\">Error<\/th>\n<th style=\"padding:14px;text-align:left;\">Meaning<\/th>\n<th style=\"padding:14px;text-align:left;\">Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Too many redirects<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">SSL mode is Flexible while the site forces HTTPS<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Switch to Full (strict).<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">521<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">The server refused the connection<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Check that Apache is running and that the firewall allows Cloudflare.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">522<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">The connection to the server timed out<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Check server load and the firewall, and that the DNS record points to the right IP address.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">525 or 526<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">SSL problem between Cloudflare and the server<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Check that AutoSSL issued a valid certificate for the domain.<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Email stopped working<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Mail records are proxied<\/td>\n<td style=\"padding:14px;border-top:1px solid #E5E7EB;vertical-align:top;\">Set mail and MX records to DNS only.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div aria-hidden=\"true\" class=\"uh-section-divider\" style=\"width:min(100% - 32px, 1080px);margin:44px auto;display:grid;grid-template-columns:1fr 32px 1fr;align-items:center;gap:18px;pointer-events:none;\"><span style=\"height:1px;background:linear-gradient(90deg,transparent,rgba(0,212,255,0.40),rgba(23,110,165,0.24),transparent);\"><\/span><img alt=\"\" decoding=\"async\" height=\"32\" loading=\"lazy\" src=\"https:\/\/cdn.underhost.com\/android-chrome-192x192.webp\" style=\"width:32px;height:32px;display:block;border-radius:8px;filter:drop-shadow(0 0 14px rgba(0,212,255,0.30));\" width=\"32\"\/><span style=\"height:1px;background:linear-gradient(90deg,transparent,rgba(23,110,165,0.24),rgba(0,212,255,0.40),transparent);\"><\/span><\/div>\n<\/div>\n<div class=\"uh-blog-cta\" style=\"background:linear-gradient(135deg,#0D1F3C 0%,#125A8A 58%,#176EA5 100%);color:#ffffff;padding:36px 24px;border-radius:20px;text-align:center;margin:44px 0;box-shadow:0 20px 40px -15px rgba(13,31,60,0.32);\">\n<h2 style=\"margin:0 0 12px;font-size:28px;line-height:1.25;color:#ffffff;\">Need help with this?<\/h2>\n<p style=\"font-size:17px;margin:0 auto 22px;color:#EAF6FF;max-width:720px;line-height:1.7;\">Want Cloudflare set up correctly on your cPanel server? Our team can configure DNS, SSL, real IPs and caching for you.<\/p>\n<p><a href=\"https:\/\/underhost.com\/server-management.php\" style=\"background:linear-gradient(90deg,#00D4FF,#0077FF);color:#ffffff;padding:13px 28px;border-radius:10px;text-decoration:none;font-weight:800;display:inline-block;margin:8px;\">See server management plans<\/a><a href=\"https:\/\/customerpanel.ca\/client\/\" style=\"background:transparent;color:#ffffff;padding:12px 28px;border-radius:10px;text-decoration:none;font-weight:800;display:inline-block;margin:8px;border:1px solid rgba(255,255,255,0.32);\">Contact @CustomerPanel<\/a><\/div>\n<div class=\"uh-faq-section\" id=\"faq\" style=\"margin:34px 0;scroll-margin-top:90px;\">\n<h2 style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:0 0 18px;border-bottom:2px solid rgba(0,212,255,0.22);padding-bottom:10px;\">Frequently asked questions<\/h2>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Does Cloudflare work with cPanel AutoSSL?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">Yes. Keep AutoSSL on the server and use the Full (strict) SSL mode in Cloudflare.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Should cPanel and webmail be proxied through Cloudflare?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">No. Set cpanel, webmail, whm, mail and ftp records to DNS only, so those services connect straight to the server.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Why do my logs show Cloudflare IP addresses?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">Apache sees Cloudflare as the visitor. Install mod_remoteip and trust Cloudflare&#8217;s IP ranges, as shown in Step 3.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Can Cloudflare cache my WordPress pages?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">Yes, with a Cache Rule, as long as you bypass the cache for logged-in users, the admin area and cart or checkout pages.<\/p>\n<\/div>\n<div style=\"margin-top:18px;background:#F8FAFC;padding:18px 20px;border-radius:14px;border:1px solid rgba(23,110,165,0.14);\">\n<h3 style=\"color:#0D1F3C;margin:0 0 8px;font-size:19px;\">Is the free Cloudflare plan enough?<\/h3>\n<p style=\"margin:0;color:#1F2937;line-height:1.7;\">For most small sites, yes. Paid plans add more WAF rules, image optimisation and other features.<\/p>\n<\/div>\n<\/div>\n<p><!-- uh-related-start --><\/p>\n<div style=\"background:#F4F8FC;border:1px solid #DCE7F3;border-radius:14px;padding:18px 22px;margin:32px 0 8px;\">\n<h2 style=\"margin:0 0 12px;font-size:22px;\">Related guides<\/h2>\n<ul style=\"margin:0;padding-left:20px;\">\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/how-to-install-clamav-cpanel\/\">How to Install and Use ClamAV Antivirus in WHM\/cPanel<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/ssh-cpanelwhm-command\/\">cPanel and WHM Scripts: How to Find and Use Them Safely<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/automatic-cpanel-backup-domain-mysql-with-cron-php\/\">Automatic cPanel Backups: A Safer Way to Schedule Them<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/creating-custom-email-filters-in-cpanel-for-better-email-management\/\">Creating Custom Email Filters in cPanel for Better Email Management<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/underhost.com\/blog\/how-to-use-whms-email-deliverability-interface-to-fix-mail-dns-issues\/\">How to Use WHM\u2019s Email Deliverability Interface to Fix Mail DNS Issues<\/a><\/li>\n<\/ul>\n<\/div>\n<p><!-- uh-related-end --><br \/>\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Does Cloudflare work with cPanel AutoSSL?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Keep AutoSSL on the server and use the Full (strict) SSL mode in Cloudflare.\"}}, {\"@type\": \"Question\", \"name\": \"Should cPanel and webmail be proxied through Cloudflare?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. Set cpanel, webmail, whm, mail and ftp records to DNS only, so those services connect straight to the server.\"}}, {\"@type\": \"Question\", \"name\": \"Why do my logs show Cloudflare IP addresses?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Apache sees Cloudflare as the visitor. Install mod_remoteip and trust Cloudflare's IP ranges, as shown in Step 3.\"}}, {\"@type\": \"Question\", \"name\": \"Can Cloudflare cache my WordPress pages?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes, with a Cache Rule, as long as you bypass the cache for logged-in users, the admin area and cart or checkout pages.\"}}, {\"@type\": \"Question\", \"name\": \"Is the free Cloudflare plan enough?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"For most small sites, yes. Paid plans add more WAF rules, image optimisation and other features.\"}}]}<\/script><\/p>\n<h2 id=\"sources\" style=\"color:#0D1F3C;font-size:28px;line-height:1.25;margin:34px 0 14px;scroll-margin-top:90px;\"><i class=\"fas fa-book\" style=\"color:#00D4FF;\"><\/i> Sources<\/h2>\n<ul style=\"margin:0 0 24px;padding-left:22px;\">\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/www.cloudflare.com\/ips\/\">Cloudflare: IP ranges<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/developers.cloudflare.com\/ssl\/origin-configuration\/ssl-modes\/\">Cloudflare: SSL\/TLS encryption modes<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/developers.cloudflare.com\/cache\/how-to\/cache-rules\/\">Cloudflare: Cache Rules<\/a><\/li>\n<li style=\"margin:0 0 8px;\"><a href=\"https:\/\/developers.cloudflare.com\/support\/troubleshooting\/restoring-visitor-ips\/restoring-original-visitor-ips\/\">Cloudflare: restoring original visitor IPs<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Enhance website speed, security, and reliability by integrating Cloudflare with cPanel &#038; WHM.<\/p>\n","protected":false},"author":1,"featured_media":4638,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,202,207],"tags":[161,108,122,137,124,109],"class_list":["post-5029","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-control-panels","category-cpanel-whm","category-performance-seo","tag-cloudflare","tag-tag-cpanel","tag-tag-dns","tag-tag-firewall","tag-tag-ssl","tag-tag-whm"],"_links":{"self":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/5029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/comments?post=5029"}],"version-history":[{"count":10,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/5029\/revisions"}],"predecessor-version":[{"id":6911,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/5029\/revisions\/6911"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media\/4638"}],"wp:attachment":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media?parent=5029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/categories?post=5029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/tags?post=5029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}