You need to make some changes in nginx to make this work. There are a few different ways.
The easiest (but not the cleanest) way I’ve found is to get into the command line:
ghost config url https://www.onlinehikes.com
ghost setup nginx ssl
This creates the necessary SSL certificates and Nginx files to handle redirecting properly.
ghost config url https://onlinehikes.com to reset the domain setting.
Then you need to edit the two new Nginx files that are created (you’ll see them printed in the console) starting with
www.onlinehikes.com (one will have
-ssl in the name and one won’t).
server block add a new line (do the same in both files):
return 301 https://onlinehikes.com$request_uri;
This will direct all traffic to your www domain, to your non-www domain.
Like I said, this may not be the cleanest way to do this but it’s the easiest I’ve discovered. Alternatively you could edit the existing Nginx files and create the SSL certificates from the command line. If anyone has any feedback on this, I’d love to hear it.