Running Two Ghost Websites on the Same VPS, Both Show the Same Page

Hi everyone,

I’m reaching out because I’ve run into a bit of an issue while setting up two separate Ghost websites on the same VPS. Both websites are running fine individually, but for some reason, they both show the same content despite being configured to run on different ports and domains.

Here’s the setup:

  • I have two Ghost websites installed on my VPS: one for quikseekr.com and another for mediuminside.com.
  • Both are configured to run on different ports: fluentpatt.com on port 2368 and mediuminside.com on port 2369.
  • I’m using Nginx as a reverse proxy to route traffic to the correct ports based on the domain name.

The problem is that both websites display the same content (the first website) no matter which domain I visit. It seems like Nginx is routing the traffic correctly to the appropriate port, but somehow the second Ghost instance (running on port 2369) is showing the same page as the first one (on port 2368).


*** Both Ghost instances are running with different ports.**
*** The configuration files for Nginx appear to be set up correctly, with the server_name and proxy_pass pointing to the right ports.**
*** Both websites are using separate domains and SSL certificates (via Let’s Encrypt).**

  GNU nano 7.2                             /etc/nginx/sites-available/mediuminside.com.conf                                      
map $status $header_content_type_options {
    204 "";
    default "nosniff";
}

server {
    listen 80;
    listen [::]:80;

    server_name mediuminside.com;
    root /var/www/newwebsite/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2369;

        add_header X-Content-Type-Options $header_content_type_options;
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}


type or paste code here
server {
    listen 80;
    listen [::]:80;

    server_name quikseekr.com;
    root /var/www/quikseekr_com/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

I install new ghost on second server both show running but seems the web point to the same link. the new website show only one!
Any idea I check Nngix and chane the port and the issue persist

You restarted nginx after changing configurations, right? And the files are in sites-enabled (or linked from there), not just sites-available, right?

I don’t see the https versions of each file in your post above. You have those also, right?

Please send any command to check the links between the nginx

I try

sudo ln -s /etc/nginx/sites-available/mediuminside.com.conf /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/quikseekr.com.conf /etc/nginx/sites-enabled/

output

sudo ln -s /etc/nginx/sites-available/mediuminside.com.conf /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/quikseekr.com.conf /etc/nginx/sites-enabled/
ln: the symbolic link '/etc/nginx/sites-enabled/mediuminside.com.conf' could not be created: the file already exists
ln: the symbolic link '/etc/nginx/sites-enabled/quikseekr.com.conf' could not be created: the file already exists

Ghost CLI got it correctly setup. Now you need to fix nginx configuration given your last screenshot.

Are the DNS records in place and pointing to the same IP?
What path does the default server in nginx point to?
Why isn’t SSL setup in nginx? (Does ghost-cli create separate config files for http and https?)

Great, so those files are there. Do you have the domain.com-ssl.conf version also? Are they linked?

nginx -t to test config
nginx -s reload to load the new config

server {
listen 80 default_server;
listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

ghostadmin@v2202406227393275735:/var/www$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Gotcha. None of your ghost sites should be using the default server. Then it’s something else in the nginx files that is wonky.