Enabling HTTPS with Cloudflare on Ghost
While I have HTTPS enabled for the https://steven.re domain, with Cloudflare and Apache set up to force TLS for any sub-directory, somehow Ghost wasn't playing very nice with it and still redirecting to the plain old http connection. All was not lost, however, as with a couple of different options on Cloudflare I was able to get it going.
Before we get started, make sure that your config.js file has your blog's URL written down with HTTPS rather than just HTTP (for example, mine would be recorded as https://steven.re/blog). Then it's a matter of
- Navigating over to Cloudflare, logging in, selecting the relevant domain, and clicking on the
Page Rulestab. - If your blog is on a sub-directory like mine, enter the sub-directory (in my case it's
/blog/) in theURL patterntextbox. If it's on a sub-domain or just the domain by itself, enter*domain.com/*wheredomain.comis your domain. - Press the
Always use httpsbutton -- don't bother with any of the other rules, because whileAlways use httpsis active, you can't edit them.
And there you have it -- full HTTPS over your Ghost blog. You can modify this as you like and limit it to only the /ghost/ sub-directory if you only want to run the administrator/author section over HTTPS -- it's really up to you.