Set up Ghost on subdomain specific coniguration

I’m hosting a Rails application, personal site and personal blog on the same droplet. Whenever I go to I get the Rails site rather than the Ghost blog.

There are a few posts already detailing Ghost on subdomains with Nginx server blocks but I haven’t had much success and I think it may be because of the nature of my setup.

I’m running a Rails application with passenger, it works and everything is fine there. The DNS records for my personal site are Digital Ocean but the site itself is So has a CNAME of

Now I am trying to set up a Ghost blog on

I have an A record for a blog that points to my droplet’s IP. I have a server block (the one that Ghost creates for you). But whenever I go to I get my Rails application mentioned above.

I’m wondering if this is an Nginx issue, a DNS issue or something else I’m missing.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

As it turns out it was an issue with my certificate, I was not aware that a misconfigured certificate would cause a redirect to the default server but this was the case. I used the default certificate that the Ghost install gives you the option of creating but for whatever reason, it did not work. I ran a certbot --nginx for the subdomain and everything started working!

Hi @tfantinaStarfish,

The way you’ve described it, I can confirm this is not a DNS issue but an Nginx one. Most probably somewhere in the config file something is missing and thus redirecting you to your main website. Can you please provide us with the Nginx configuration file for so that I can see if everything has been configured properly?

Regards, KFSys