New server and suddenly: Mixed content errors

We were using CloudFlare on our domain for about a year and everything was running perfectly.

Last week we migrated to a new server at the same hosting company. They copied everything over identically to the new server.

When we re-enabled Cloudflare, we cleared the cache and updated the DNS entries to point to the new server’s IP, but our site gets completely broken.

Every single page suddenly is getting “mixed content errors” complaining about stylesheets and other content being loaded over http instead of https. None of our pages specifically include http:// in URLs.

When we disable CloudFlare (pointing our nameservers away from CF), our site works properly, so it’s definitely something in CloudFlare.

Why is CF suddenly serving up http instead of https URLs in all our content. What do we have to do after switching to a new server? Is it something to do with the universal ssl certificate? Does it need to be regenerated or renewed since we’re on a new server?

This never is Cloudflare :wink:

What’s the domain?

1 Like

I assume you have it off Cloudflare right now. Keep in mind Cloudflare will remove your domain this case.

But I just loaded it through Cloudflare and it loaded fine without any mixed content. The only peculiar thing was that Rocket Loader was being added several times, which shouldn’t exactly happen.

Maybe try disabling Rocket Loader for a test, though as I said I did not get mixed content.

How do you test load it through CloudFlare?

Last time I switched the DNS back to CloudFlare was about 12 hours ago and I was still getting mixed content errors. Afterwards, in WP Rocket, I changed a setting to force https from CF, so maybe that fixed something. But it still doesn’t explain why I have to turn on that setting when I never had to do that before.

Thanks for your responses, btw!

If your server sends mixed content which Cloudflare cannot fix (or you haven’t enabled it) then that content will hit the server.

I would suggest you re-activate Cloudflare and check. Also check for the Rocket Loader issue.

One note: Rather than changing nameservers, instead use Cloudflare’s dashboard to Pause, this will update DNS records served by Cloudflare and will update within 5 minutes, rather than the up-to-48h of changing nameservers.

I switched DNS back to CF and it’s still the same issue. Tried rocket load off and on. All settings seem correct, and yet tons of mixed content errors on each page. When pausing CF, the site goes back to normal.

Sucks. The exact same site, with no updates, was working perfectly before, so it’s nothing in our content causing the issue. It’s just that’s it’s on a new physical server.

I may have to just cancel CF and sign up for a fresh account and see if that fixes it, or try another CDN.

Still no mixed content issue here. I would suggest you clear your browser cache and try a different browser. Also check the browser console.

I had cleared browser caches and checked the console. All the errors are from style sheets being loaded via http instead of https, which breaks our page builder so each page doesn’t finish loading.

Nowhere in our pages do we have full URLs, only for eg: /css/stylesheet.css. When I pause CF and clear my browser caches, the errors disappear and the site works normally.

Have you tried clearing the Cloudflare cache too? Maybe your PoP still has some mixed content version cached.

As evident from the earlier screenshot it does load fine via Cloudflare. So it is either a local issue or a caching issue on your PoP.

And our customers are mentioning seeing the same issues whenever I enable CF.

Yes, I had cleared the cache a few times. Also the cache from the caching plugin on our site.

Well, I am afraid I cannot reproduce that issue. Cloudflare does not return any mixed content.

You could try opening a support ticket.

Yes, I will. Appreciate all your time and responses!

Which operating system are you using?

I’m on MacOS, but I tried Chrome on Windows and had the same issues. A couple customers on iOS and Android saw broken pages too when CF was activated.

Just “1” result.

And yet, whenever I re-enable Cloudflare, clear my caches and reload a page, I get:

I adjusted the call, run it again but it does seem as if it didn’t return any HTTP links either. That would be a browser issue then.