Shared Physics
A blog by Roman Kudryashov
Shared Physics

Getting HTTPS to Work Properly on an AWS/Bitnami Ghost Installation

Published on 1 min read

TLDR: Sometimes HTTPS doesn't get configured when you install Ghost on AWS. Here's how to fix it.

To get HTTPS on your site, you need to follow two steps. First, you need to set up your SSL certificate. If you're using Bitnami, it's very straightforward. As per their documentation, you just need to run their HTTPS Configuration Tool:

Execute the following command and follow the prompts:

sudo /opt/bitnami/bncert-tool

But going through this process only got me halfway there. I noticed that some .js calls were being made over HTTP, which caused CORS issues and generally stopped the membership features from working correctly. I tried setting up Apache Force HTTPS as per Bitnami's documentation and it didn't help.

The solution was the following, as per https://community.bitnami.com/t/how-to-get-https-working-80-redirect-loop-issues-resolved-ghost-gcp/55867/3:

There are two issues after setting up your SSL certificate. You'll notice your nav links have :80 appended to the end, and of course lack the S in https.

First part - Fix Ghost URL

Stop Ghost & open the Ghost config file:

sudo /opt/bitnami/ctlscript.sh stop
sudo vim /opt/bitnami/apps/ghost/htdocs/config.production.json

Edit the URL part to include the s after http. Remove the :80. Then, Enable Apache's protocol proxy pass.

sudo vim /opt/bitnami/apps/ghost/conf/httpd-app.conf

Add this to the top of the file:

RequestHeader set X-Forwarded-Proto "https"

Restart Ghost.

sudo /opt/bitnami/ctlscript.sh start

... and you're set.

Thanks for reading

Useful? Interesting? Have something to add? Shoot me a note at roman@sharedphysics.com. I love getting email and chatting with readers.

You can also sign up for irregular emails and RSS updates when I post something new.


Who am I?

I'm Roman Kudryashov. I'm a healthcare technologist and organizational fixer with too many side projects. I typically work with early and mid-stage companies to build, fix, or scale operations. I've done this for product, engineering, data, marketing, and design teams. My longer background is here and I keep track of some of my side projects here.


Stay true,
Roman