Image showing in draft but not in preview or published: not all links are HTTPS

When editing, all the images are showing however when I go to preview or publish only the Videos and article image show. The rest are all broken links

If I right-click on the broken link and choose open image in new tab, it opens (

The code looks as follows:

<figure class="kg-card kg-image-card"><img src="" class="kg-image" alt="" loading="lazy" width="2000" height="924" srcset=" 600w, 1000w, 1600w, 2000w" sizes="(min-width: 720px) 720px"></figure>
1 Like

Worked out the cause but need to still figure out how to fix it.

It has do do with my reverse proxy and maybe also with my cloudflare settings.

Will look at it over the next few days and update once sorted.

1 Like

So the issue is that when you look at the HTML, the image is via HTTP and not HTTPS which is required by the site and hence the image on the page does not show. Where do I set things so that all site content referenced in the HTLP has HTTPS links?

1 Like

I tried

ghost config url

but that made no difference.

1 Like

Did you restart Ghost after setting the URL?

1 Like

Yes. I have done a new install now: This link shows what is happening:

I might need to start again. It has something to do with nginx and cloudflare I think. This is the only site this is happening to for me though.

I have set the url back to HTTPS, SSL is not installed on ghost as I am letting NGINX Proxy Manager look after that for me.

It looks like Ghost is still not properly configured. The config is showing the site URL with http.

curl --silent  | jq .site.url

Ok so I have done the following:

ghost config url

but when I try running setup ssl, I get

Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  /etc/letsencrypt/ --issue --home /etc/letsencrypt --server letsencrypt --domain --webroot /var/www/ --reloadcmd "nginx -s reload" --accountemail --keylength 2048
[Sun Mar 10 21:48:24 UTC 2024] Invalid status, error detail:2606:4700:3037::ac43:970c: Invalid response from 404
[Sun Mar 10 21:48:24 UTC 2024] Please add '--debug' or '--log' to check more details.
[Sun Mar 10 21:48:24 UTC 2024] See:

[Sun Mar 10 21:48:18 UTC 2024] Using CA:
[Sun Mar 10 21:48:18 UTC 2024] Single domain=''
[Sun Mar 10 21:48:18 UTC 2024] Getting domain auth token for each domain
[Sun Mar 10 21:48:21 UTC 2024] Getting webroot for domain=''
[Sun Mar 10 21:48:21 UTC 2024] Verifying:
[Sun Mar 10 21:48:22 UTC 2024] Pending, The CA is processing your order, please just wait. (1/30)

Exit code: 1

Debug Information:
    OS: Ubuntu, v22.04.4 LTS
    Node Version: v18.19.1
    Ghost Version: 5.80.2
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost setup ssl'

Additional log info available in: /home/sysadmin/.ghost/logs/ghost-cli-debug-2024-03-10T21_48_25_689Z.log

After running ghost config ..., you need to run ghost restart for the changes to be picked up. You don’t need to do anything else.

So I reinstalled everything but I landed up with the same issue. It appears to have something to do with CloudFlare, Nginx proxy manager and the way Ghost works with certificates.

Do you have Cloudflare set to strict/full for proxying?

curl --silent  | jq .site.url

I’m still getting an HTTP url here. Can you try directly making this request to the Ghost instance, so you’ll either know if Ghost is incorrectly set up, or if there’s a broken cache?

If you run ghost ls, you can get the port that ghost is listening on and replace PORT with that number in the command.

curl --silent -H "Host:" -H "X-Forwarded-Proto: https" | sed 's/,/\n/g' | grep url

I have installed the certs and set URL to HTTPS but the image is still not showing when the page loads… it appears to be linked via http and not https.

To make sure that the issue was not else where in the network.

I updated my host file so that the domain pointed directly to my local IP for Ghost and the same thing happens i.e. the site resolves to https without any cert issues but the article images (not video or main blog image) appear as broken links (because of the HTTP reference). If you click on them, they open correctly as the URLS are HTTPS.

I can’t help you if you don’t provide the debug information I’m asking for.

Sorry, missed that request.

It is still saying “url”:“

I also added notes to my previous reply.

sysadmin@webserver-01:/var/www/southernhikes$ sudo curl --silent | jq .site.url “
jq: error: Could not open file No such file or directory

Can you please run this command:

curl --silent -H "Host:" -H "X-Forwarded-Proto: https" | jq .site.url

Ok thanks for your help. I think it’s sorted.

The first time I ran it I got HTTP so I reran

host config url

And it updated it this time.

I must have been doing something wrong when I tired previously as the update did not happen.

Thanks for your patience and help. I have a good understanding now of how this all hangs together as well as how to troubleshoot this :)

1 Like