DigitalOcean and DNS Settings

Hi guys, you have done me well so far so thought I’d try get this issue sorted here too.

I have a Digital Ocean Droplet setup to run Ghost :tada: and it works fine at https://hoddzdj.com, yay! But, if you try to visit the site via http://www.hoddzdj.com you are faced with a DO window to tell me to configure the droplet via SSH (even though I already have) and get an error when trying to visit https://www.hoddzdj.com.

Is there a way to easily route all this to https://hoddzdj.com?

Below is my custom DNS settings for the domain, which were completed a few days ago. As far as I can work out, everything is setup correctly. Any help would be greatly appreciated!

1 Like

Hey friend!

That is odd about the SSH message. Can you try creating the droplet again and see if that reoccurs? I’ve had another similar report and I’ll work with our team to see if I can isolate the cause. In the meantime, it hasn’t happened consistently so creating again should not result in a second occurrence (it is a dice roll though, I suppose).

As for the DNS, try setting www to a CNAME that points to the root domain instead of an A record. I can confirm that I do not have any SSL errors on www for my Discourse installation which has that configuration, despite the certificate not being signed for www or that I use https when visiting www. I’m thinking that should work the same for you then with Ghost.

Let me know if you have any more trouble from there, happy to help!

Your friend at DigitalOcean,
Jarland

A couple of tips:

  1. Only have 1 A record, the @ one should be correct rather than the *. Definitely use a CNAME for the redirect as mentioned by @Jarland_Donnell.
  2. Try running ghost setup nginx ssl again - that might work.
  3. If you’re trying to get both www and non-www to work, you’ll need to do extra config - there’s a guide for setting up extra domains here: https://docs.ghost.org/docs/cli-knowledge-base#section-ssl-for-additional-domains

@Jarland_Donnell I think I know what the issue is - the default nginx template looks like this: do-default-nginx · GitHub

It has the “default_server” directive. As far as I know, there’s nothing in the image cleaning that file up, and so nginx will still serve it. I’m not 100% when default_server takes priority, so I’m not sure why it’s not easily reproducible.

1 Like

Looking at it again, I don’t understand why it’s not consistent! However, I cannot reproduce.

The way to fix it would be to remove the default file from /etc/nginx/sites-enabled/ and reload nginx.

So rm /etc/nginx/sites-enabled/default and nginx -s reload

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.