"Mixed Content" errors from DigitalOcean install

After a fresh install of Ghost 4.39 on a DigitalOcean droplet, with a successful SSH connection and correctly propagated DNS, I get get following errors which prevent users from clicking anything related to subscriptions:

api.js:31 Mixed Content: The page at 'https://domain.com/' was loaded over HTTPS, but requested an insecure resource 'http://domain.com/members/api/site/'. This request has been blocked; the content must be served over HTTPS.

o @ api.js:31
api.js:31 Mixed Content: The page at 'https://domain.com/' was loaded over HTTPS, but requested an insecure resource 'http://domain.com/members/api/member/'. This request has been blocked; the content must be served over HTTPS.
o @ api.js:31

and

[Portal] Failed to initialize: TypeError: Failed to fetch
    at o (api.js:31:16)
    at Object.read (api.js:62:20)
    at api.js:345:22
    at u (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at f (asyncToGenerator.js:3:20)
    at a (asyncToGenerator.js:25:9)
    at asyncToGenerator.js:32:7
    at new Promise (<anonymous>)
(anonymous)	@	App.js:168

I suspect it has something to do with the way the LetsEncrypt SSL was installed. What can I do to diagnose the issue further?

If you’re looking to use SSL for your site, your URL has to be configured as the same!

run ghost config set url https://your.domain, and then ghost restart :slightly_smiling_face:

1 Like

Unfortunately I’m getting the following:

root@server_name:~# sudo -i -u ghost-mgr
ghost-mgr@server_name:~$ ghost config set url https://domain.com
Working directory is not a recognisable Ghost installation.
Run `ghost config set` again within a folder where Ghost was installed with Ghost-CLI.

I had assumed that accessing ghost-mgr on the server was enough to refer to the correct folders. Is that fair to assume?

Nope, you can have multiple installations of Ghost on 1 machine, so you have to be in the proper directory! You can run sudo -u ghost-mgr ghost ls to see your installation information

1 Like