I’m new to Ghost and I have just set up a ghost instance on AWS lightsail. I have followed the given guideline document and executed all steps successfully as per the doc
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-quick-start-guide-ghost
But when I finished setting up and try to view the ghost application I’m experiencing many issues related to HTTPS.
- Subscribe button is not clickable (Have console errors)
- When logged in as admin portal is not loading (Have console errors)
Console error is common for both the scenarios and it’s coming like below
VM8:1 Mixed Content: The page at 'https://www.<my-domain>.com/' was loaded over HTTPS, but requested an insecure resource 'http://www.<my-domain>.com/members/api/member/'. This request has been blocked; the content must be served over HTTPS.
To fix this issue I have run the below command to update the ghost URL in the config file because the previous one was non-HTTPS.
ghost config url https://<my-domain>.com
ghost restart
Now once I do that when I try to go to my application from the browser it redirects to
https://127.0.0.1:2368/
here is my config.production.json file content related to URL.
Can someone help me to fix this issue? Have I done anything wrong here?
3
Answers
I was able to solve this using following.
add
RequestHeader set X-Forwarded-Proto "https"
to following file /opt/bitnami/apache2/conf/vhosts/APPNAME-https-vhost.conf
reassure that your port in ghost config json and proxy pass in nginx/apache configs are the same after URL change and restarting.
Steps You Need To Perform To Resolve This Issue :
Note : ghost is installed on aws lightsail with Bitnami Package with version 4.48.x at the time of answering this question.
1. Upgrade Ghost
In the Ghost installation directory, execute the update command as follows:
To finish the update, modify file permissions:
Note: at the time , I was upgraded to v5.37.x
2. Configure HTTPS Domain Name
go to /opt/bitnami/ghost/config.production.json
change line :
restart ghost and apache services
check ghost status :
you might get the response :
3. Reboot your LightSail instance from LightSail console
rebooting lightsail instance is necessary if the problem isn’t resolved by just restarting ghost and apache services
That’s It.
Resources:
Ghost Upgrade Bitnami
Configure The Ghost Domain Name