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

Posted September 7, 2018 5.7k views
GhostDigitalOcean 1-Click Apps MarketplaceUbuntu 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: , it works fine.

Then I added an A record pointing to my ip (ipv4), but it doesn’t work, I cant visit 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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
  3. then, generate a ssl setup running ghost setup nginx ssl
  4. set again your main domain ghost config url
  5. edit the nginx config files for your second domain to redirect to your main domain: edit both: /system/files/ and /system/files/ , replacing the content of the first location block (leave the .well-known location block - this is used for renewing certificates) with:
return 301$request_uri;

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