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

**URL:** <https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570>\
**Category:** Using Ghost\
**Created:** [March 10, 2024, 4:09am UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570 "2024-03-10T04:09:18Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 4:09am UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/1 "2024-03-10T04:09:18Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/9/b/9be4a14ed9c4ea1137328deda4ef22a4cf9073ae.png)

If I right-click on the broken link and choose open image in new tab, it opens ([https://www.southernhikes.co.nz/content/images/size/w1000/2024/03/20240222\_132427-3.jpg](https://www.southernhikes.co.nz/content/images/size/w1000/2024/03/20240222_132427-3.jpg))

The code looks as follows:

```auto
<figure class="kg-card kg-image-card"><img src="https://www.southernhikes.co.nz/content/images/2024/03/here-to-there.jpg" class="kg-image" alt="" loading="lazy" width="2000" height="924" srcset="http://www.southernhikes.co.nz/content/images/size/w600/2024/03/here-to-there.jpg 600w, http://www.southernhikes.co.nz/content/images/size/w1000/2024/03/here-to-there.jpg 1000w, http://www.southernhikes.co.nz/content/images/size/w1600/2024/03/here-to-there.jpg 1600w, http://www.southernhikes.co.nz/content/images/2024/03/here-to-there.jpg 2000w" sizes="(min-width: 720px) 720px"></figure>

```

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 7:31pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/2 "2024-03-10T19:31:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 8:21pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/3 "2024-03-10T20:21:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 8:32pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/4 "2024-03-10T20:32:35Z")

</div>

I tried

```auto
ghost config url https://myurl.com

```

but that made no difference.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 10, 2024, 8:44pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/5 "2024-03-10T20:44:28Z")

</div>

Did you restart Ghost after setting the URL?

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 8:55pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/6 "2024-03-10T20:55:58Z")

</div>

Yes. I have done a new install now: This link shows what is happening: [https://www.southernhikes.co.nz/test/](https://www.southernhikes.co.nz/test/)

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.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 10, 2024, 9:34pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/7 "2024-03-10T21:34:26Z")

</div>

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

```auto
curl --silent https://www.southernhikes.co.nz/ghost/api/admin/site/ | jq .site.url
"http://www.southernhikes.co.nz/"

```

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 10, 2024, 9:58pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/8 "2024-03-10T21:58:24Z")

</div>

Ok so I have done the following:

` ghost config url https://www.southernhikes.co.nz`

but when I try running setup ssl, I get

```auto
Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' /etc/letsencrypt/acme.sh --issue --home /etc/letsencrypt --server letsencrypt --domain www.southernhikes.co.nz --webroot /var/www/southernhikes.co.nz/system/nginx-root --reloadcmd "nginx -s reload" --accountemail southernhikes@lecontakt.com --keylength 2048
[Sun Mar 10 21:48:24 UTC 2024] Invalid status, www.southernhikes.co.nz:Verify error detail:2606:4700:3037::ac43:970c: Invalid response from http://www.southernhikes.co.nz/.well-known/acme-challenge/xxxxxxxxxxxxxxxxxxxx: 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: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh

[Sun Mar 10 21:48:18 UTC 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Mar 10 21:48:18 UTC 2024] Single domain='www.southernhikes.co.nz'
[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='www.southernhikes.co.nz'
[Sun Mar 10 21:48:21 UTC 2024] Verifying: www.southernhikes.co.nz
[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

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 10, 2024, 10:07pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/9 "2024-03-10T22:07:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 11, 2024, 7:21am UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/12 "2024-03-11T07:21:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [March 11, 2024, 11:16am UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/13 "2024-03-11T11:16:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 11, 2024, 2:38pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/14 "2024-03-11T14:38:28Z")

</div>

```auto
curl --silent https://www.southernhikes.co.nz/ghost/api/admin/site/ | jq .site.url
"http://www.southernhikes.co.nz/"

```

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.

```auto
curl --silent http://127.0.0.1:PORT/ghost/api/admin/site/ -H "Host: www.southernhikes.co.nz" -H "X-Forwarded-Proto: https" | sed 's/,/\n/g' | grep url

```

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 11, 2024, 5:32pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/15 "2024-03-11T17:32:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 11, 2024, 6:27pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/16 "2024-03-11T18:27:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 11, 2024, 6:30pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/17 "2024-03-11T18:30:35Z")

</div>

Sorry, missed that request.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/b/c/bc4528f0b41fde03d9b7bb431989e1e394e0ce55.png)

It is still saying “url”:“[http://www.southernhikes.co.nz/](http://www.southernhikes.co.nz/)”

I also added notes to my previous reply.

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 11, 2024, 6:33pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/18 "2024-03-11T18:33:52Z")

</div>

> sysadmin@webserver-01:/var/www/southernhikes$ sudo curl --silent [https://www.southernhikes.co.nz/ghost/api/admin/site/](https://www.southernhikes.co.nz/ghost/api/admin/site/) | jq .site.url “[http://www.southernhikes.co.nz/](http://www.southernhikes.co.nz/)”  
> jq: error: Could not open file [http://www.southernhikes.co.nz/:](http://www.southernhikes.co.nz/:) No such file or directory

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [March 11, 2024, 6:39pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/19 "2024-03-11T18:39:55Z")

</div>

Can you please run this command:

```auto
curl --silent http://127.0.0.1:2368/ghost/api/admin/site/ -H "Host: www.southernhikes.co.nz" -H "X-Forwarded-Proto: https" | jq .site.url

```

---

<div class="post-metadata">

**Author:** ![ZuluPilgrim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zulupilgrim/32/29267_2.png) [@ZuluPilgrim](https://forum.ghost.org/u/ZuluPilgrim)\
**Post date:** [March 11, 2024, 6:45pm UTC](https://forum.ghost.org/t/image-showing-in-draft-but-not-in-preview-or-published-not-all-links-are-https/45570/20 "2024-03-11T18:45:31Z")

</div>

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 [https://www.southernhikes.co.nz](https://www.southernhikes.co.nz)

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 :)
