Enabling HTTPS with Cloudflare on Ghost

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

  1. Navigating over to Cloudflare, logging in, selecting the relevant domain, and clicking on the Page Rules tab.
  2. If your blog is on a sub-directory like mine, enter the sub-directory (in my case it's /blog/) in the URL pattern textbox. If it's on a sub-domain or just the domain by itself, enter *domain.com/* where domain.com is your domain.
  3. Press the Always use https button -- don't bother with any of the other rules, because while Always use https is 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.