Ghost www redirecting to nginx index.html DigitalOcean


Edit: Resolved

I installed Ghost via 1-click image on DigitalOcean. However after I followed instructions the site is not accessible from www subdomain, only

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 to produce an error (invalid SSL certificate).

Configuration files are:


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 and www subdomain to both display the nginx welcome page instead of Ghost.




Hey Paul!

In order to setup ssl with ghost, you need to configure your site to run with ssl -

ghost config set url
ghost setup nginx (it will ask if you want to set up ssl, and do it)

Check out this section in the docs for information regarding multiple domains

I know this doesn’t 100% answer your question, but it will hopefully push you in the right direction :smile:


Wow that fixed it, what a pain to resolve the common www. part of the name ;p


Thank you! This was also confusing me.


@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? :thinking:


if using a domain which does-not start with www:
Automatically setup and redirect =>

if using a domain which does start www:
Automatically setup and redirect =>

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 :slight_smile:

I think that’s a cleaner way to set it up


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


Sorry for the delayed response to this - definitely think it’s doable to automatically create that redirect.