Force HTTP between Cloudflare and server

I connected Cloudflare to my website and there is an issue when I try to connect using secure connection over https - server responds with a 502 error. Everything works when I use http connections.

My hosting provider responded that it is an issue on Cloudflare-server connection and since my server is HTTP only I have to force all the connections between them to be served over HTTP. I wish for the connection between Cloudflare and the world to be https only.

How can I configure all of those - server-CF http only and CF-World https only? I’ve seen a topic on similar issue that spoke about switching to Flexible certificate on CF, but it does not work in my case.

1 Like

This can be done using Flexible SSL on the SSL/TLS app or per subdomain using a page rule.

1 Like

Thank you for the response. Could you be more specific? I mentioned earlier that I have already switched to Flexible SSL and nothing has changed (24 hours have passed) - could it be that there is something more that has to be made ?

As long as this is set then Cloudflare’s proxies will forward traffic to your origin server over http (as long as it’s not overridden by a page rule):

Is your DNS configured correctly?

The Cloudflare CDN/proxy/SSL thing will only work with records that are set to :orange:.

At the moment your site is set to Full on he SSL/TLS app and it is loading just fine over SSL. If this is referring to another domain, can you provide the URL?

Well yes, I am refering to another site - I am checking the site right now and sth has changed - now the https version returns the page, but my CSS is not working - it is served through http in head of the html file, that’s why.

I am wondering if when I’ll change them to https in head of the html file there will be no error on the http connection between my server and cludflare?

Also if I’ll switch force https on will it work only for user-cludflare connection ? and not return errors on server connection ?

tempo looks good when I use HTTPS. Whatever you’re doing, it’s working, so don’t change anything on your site.

Go ahead and turn on “Always Use HTTPS” in the Cloudflare SSL/TLS settings page. That will redirect your visitors to HTTPS, but still keep the Flexible HTTP connection between Cloudflare and your server.

I changed all internal URLs to https versions, I switched “always use https” and “automatic https rewrite” as on. SSL is set to Flexible. All seems to be working just fine.

Thank you very much for the help.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.