Nginx server block works for one subdomain but not the other.

Posted December 25, 2015 4.7k views

I am trying to install two instances of Ghost at two different subdomains:, I followed this guide to setup multiple Ghost instances:

When I visit, the blog loads. However, when I visit or, I get the vanilla nginx page. Whether or not I have the server block for ghost two enabled, goes to the nginx page.

I tried removing all server blocks from conf.d and sites-enabled. In this case, gives me the Unable to Connect page on Firefox. the www and two subdomains still go to the nginx page.

My Zone file is: 1800 IN A 1800 IN CNAME 1800 IN CNAME 1800 IN CNAME

Furthermore, If the only file I have in sites-enabled is

server {
    listen 80;

    location / {
        proxy_set_header HOST $http_host;
        proxy_redirect off;

then will load ghost page, and two will load nginx page. In this case, the url in ghost/config.js is set to and the port is set to 2368.

I’m using node v4.2.4 and nginx 1.4.6 on Ubuntu. I installed these manually following the tutorial, but I guess I missed something somewhere and I can’t figure out where.

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.

Submit an Answer
1 answer

Problem solved. Firefox wasn’t refreshing the cache sometimes. I forced it to check for outdated cache every time the page loads.