how to set "www" subdomain for one-click ghost (with SSL)

September 7, 2018 1.8k views
Ghost One-Click Install Apps Ubuntu 16.04

Hi guys, I'm new here (and new managing a vps), I followed this step-by-step guide to install a ghost blog: https://nekonejo.me , it works fine.

Then I added an A record pointing to my ip (ipv4), but it doesn't work, I cant visit https://www.nekonejo.me and I get an SSL error. can you help me to fix it? :c

ps. I'm noobie in these stuffs, and sorry for my english.

1 Answer

Ok, thanks for support team, I could solve that. If anyone need do it, just follow these steps:

  1. add an A record "www" with your vps's ip as value
  2. go to /var/www/ghost and run ghost config url https://www.mydomain.com
  3. then, generate a ssl setup running ghost setup nginx ssl
  4. set again your main domain ghost config url https://mydomain.com
  5. edit the nginx config files for your second domain to redirect to your main domain: edit both: /system/files/my-second-domain.com.conf and /system/files/my-second-domain.com-ssl.conf , replacing the content of the first location block (leave the .well-known location block - this is used for renewing certificates) with:
return 301 https://my-canonical-domain.com$request_uri;

  1. to finish run sudo nginx -t and then sudo nginx -s reload

^-^

Have another answer? Share your knowledge.