Feature_image url is http instead of https

I am running ghost on an EC2 instance with ubuntu and nginx. I have SSL set up as well as http forwarding to https. However, for my website which makes calls to the content API, I need the images urls to have ‘https:’ Other than manually replacing the strings in my code is there a way to do this?

1 Like

Those urls come from the domain you configured in ghost. You can update this url by running

ghost config set url {url}
and then restarting ghost
ghost restart

3 Likes

@tettoffensive I just posted about this the other day, and there are lots of posts about it.

https://forum.ghost.org/search?expanded=true&q=http%20images%20order%3Alatest

1 Like

Excuse me, I got a similar problem, help please.

this is my configuration file (config.production.json):

{
  "url": "https://imseek.cn",
  "server": {
    "port": 2369,
    "host": "127.0.0.1"
  },
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "smtp.exmail.qq.com",
      "auth": {
        "user": "i@imseek.cn",
        "pass": "*****"
      }
    }
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/lib/ghost/content"
  }
}

The problem, when open the target url https://imseek.cn/about/, the picture I upload in page rejected because it’s url has http protocol, but the domain imseek.cn was https.

My nginx configuration file:

#[root@imseek ghost]# cat /etc/nginx/conf.d/imseek.cn.conf
server {
        listen       80;
        server_name  imseek.cn www.imseek.cn *.imseek.cn;
	return 301 https://imseek.cn$request_uri;
}

server {
    	listen 443 ssl;
        server_name imseek.cn www.imseek.cn;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_certificate "/etc/nginx/ssl/www.imseek.cn.pem";
        ssl_certificate_key "/etc/nginx/ssl/www.imseek.cn.key";
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;
        location / {
            #root /etc/nginx/html/imseek.cn/;
            #index index.html;
	    proxy_pass http://ghost:2368;
	}
}

Did I write the configuration here wrong?

Please don’t bump multiple very old threads to ask the same question. Next time, please make a new thread.

Just to confirm before trying to troubleshoot: Did you restart ghost and reload nginx after making any changes?

Thanks, I found the reason, just because or env settings in my docker-compose.yaml, the url was overwritten.

1 Like