Report this

What is the reason for this report?

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

Posted on September 7, 2018

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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

^-^

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.