I installed Ghost via 1-click image on DigitalOcean. However after I followed instructions the site is not accessible from www subdomain, only denimandleather.me
It seems to redirect to var/www/html/index.html instead of Ghost.
I tried rebuilding 1-click image several times but got different errors. I also installed SSL using certbox.
I also tried not using certbox and using Ghost’s built in SSL setup but requests that were sent to http: instead of https: were not redirected and resulted in ghost not loading. Editing /var/www/ghost/config.production.json and forcing https caused https://www.denimandleather.me to produce an error (invalid SSL certificate).
Configuration files are:
etc/nginx/sites-available
Current configuration etc/nginx/sites-available/default lists the servers.
I used certbot to install SSL certificate, with /var/www/ghost/config.production.json forcing https.
I’d like all domains all to load the blog page properly instead of giving “Welcome to nginx!” message, and also always redirect to https and to make sure the SSL certificate is auto-renewed every 3 months.
Now it looks like both denimandleather.me and www subdomain to both display the nginx welcome page instead of Ghost.
@acburdine / @Aileen could we have Ghost-CLI just do this in the background? I can’t think of a case where you would ever not want to just redirect the www or non-www version?
eg.
if using a domain which does-not start with www:
Automatically setup and redirect www.domain.com => domain.com
if using a domain which does start www:
Automatically setup and redirect domain.com => www.domain.com
Could potentially also add a line to the CLI output to indicate this has happened in the background?
I don’t know how those one click server work because I’ve never tried one, but if you have access to your server via root, I would use Certbot, I’m going to include below a guide from my blog that goes over how to have ssl on any website, not only ghost.
The method that @vikaspotluri123 mentioned is one way, I personally installed Cerbot and then configured the domain to have ssl, if you go to nginx, you’ll see the changes. After configured it can redirect all the http requests to https