Ghost setup ssl not working123

Ghost built-in SSL setup has never worked for me

[mark@li666-14 ghost]$ sudo ghost setup ssl
[sudo] password for mark:
static async _run(commandName, argv = {}, extensions) {

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/bootstrap.js:6:17)

I managed to get it working using certbot - and it works fine for me, but some users are getting an insecure content message and then a 404 (?)

Meanwhile I’m also getting insecure content because the images are using http and not https://

I tried changing the url using ghost config url but then my site just stopped working completely

Also, 15chars in the a unique title and 10 char password? Both a bit excessive…

Hey @unomie, looks like you’re running on an old and unsupported version of node. Are you able to update to a compatible version?

I’m running 10_x as far as I can see?

Debug Information:
    OS: CentOS, v7.6.1810
    Node Version: v10.13.0
    Ghost-CLI Version: 1.11.0
    Environment: production
    Command: 'ghost doctor'

I’ve forced an update and updated Ghost-CLI to 2.x now getting this

[mark@li666-14 ghost]$ ghost setup ssl
Nginx config file does not exist, skipping SSL setup
ℹ Setting up SSL [skipped]

Presumably because $hostname is blank?

[mark@li666-14 ghost]$ echo $hostname
(blank line printed)

Fixed, had to insert

    proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
1 Like