Ghost hijacked my other subdomains

I’m facing a rather infuriating issue. I have Ghost running on a domain on my Nginx server. I have multiple domains running all kinds of things on this server.

Ghost is running at domainA.com.
A WordPress install is running domainB.com
A nodeJS install is running om sub.domainA.com

Now I want to run a React app on sub.domainB.com but whatever I do, the sub.domainB.com keeps redirecting me to Ghost on domainA.com

I can’t “untie” Ghost from this subdomain no matter what I tried. I removed all related sites-directives, rebooted Nginx, created it anew, rebooted again, it still keeps pointing to Ghost.
I’m getting at the point to just delete Ghost alltogether just to get this shit to work :frowning:

I have no clue why Ghost is taking THIS subdomain specifically, because no other domains do anything like this (note that the domainB.com I want to run the subdomain on isn’t even running Ghost at all).

This is the nginx server config for the subdomain: I’ve updated the ports to TRY and have Ghost not running on here, but whatever I do, it keeps showing up…

server {
        listen 6666;
        listen [::]:6666;

        root /var/www/subB;
        index index.php index.html index.htm index.nginx-debian.html;
        server_name sub.domainB.com;

        location / {
		try_files $uri $uri/ /index.php?$args;
		proxy_pass http://localhost:6666;
	}
	
	location ~ /\.ht {
		deny all;
	}

}

I’m going insane, what do I do?!

I’m running dozens of things along Ghost without a problem. And I’m getting a bit confused by that config you’ve posted.

Having Ghost running on local IP with port 2368, my Ghost config looks something like this:

server {
  listen 80;
  listen [::]:80;
  server_name example.com;
  root /var/www/ghost/system/nginx-root;
  client_max_body_size 50m;
  error_log /var/log/nginx/ghost/error.log;
  access_log /var/log/nginx/ghost/access.log;

  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;
  }

Then a random site looks something like this:

server {
  listen 80;
  listen [::]:80;
  server_name example2.com;
  root /var/www/example2/public;
  error_log /var/log/nginx/example2/error.log;
  access_log /var/log/nginx/example2/access.log;

  location / {
    try_files $uri $uri/ /index.html;
  }

In your config, Nginx listens on port 6666 and then proxies itself for some reason, which makes no sense. Without looking into all the configs, I can’t think of a reason why it would behave like that. Are you sure you’re loading that config file? Have you tried to search the logs?

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