skip to Main Content

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?

3

Answers


  1. Chosen as BEST ANSWER

    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


  2. reassure that your port in ghost config json and proxy pass in nginx/apache configs are the same after URL change and restarting.

    Login or Signup to reply.
  3. 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:

    cd /opt/bitnami/ghost
    sudo su ghost -c "ghost update"
    

    To finish the update, modify file permissions:

    sudo chown ghost:bitnami -R /opt/bitnami/ghost
    sudo chmod 640 /opt/bitnami/ghost/config.production.json
    

    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 :

    url: 'https://<yourdomain>.com',
    

    restart ghost and apache services

    sudo /opt/bitnami/ctlscript.sh restart ghost
    sudo /opt/bitnami/ctlscript.sh restart apache
    

    check ghost status :

    sudo /opt/bitnami/ctlscript.sh status ghost
    

    you might get the response :

    ghost not running
    

    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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search