VM8:1 Mixed Content issue with Ghost

Viewed 75

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.

  1. Subscribe button is not clickable (Have console errors)
  2. 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.

enter image description here

Can someone help me to fix this issue? Have I done anything wrong here?

2 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.

Related