Two domains on one server, site being redirected?

Hi everyone, I have two separate domains being hosted on a Vultr VPS (single IP address). I am trying to use Cloudflare on each domain (separate accounts).

I had free SSL’s installed on each domain, however when I try to go to domain2 I get redirected to domain1 (default domain on Vultr).

I am not sure if I messed up the DNS records or if it is an SSL issue. I am currently in the process of removing the SSL’s and reissuing them separately. I will post screen shots of each Cloudflare and Vultr DNS settings in an imgur link below.

DNS Setting Screenshots

Its not a DNS issue, the problem is somewhere with your server configuration as that redirect comes straight from your server.

HEAD / HTTP/1.1
Host: www.mastersaddles.ca

HTTP/1.1 301 Moved Permanently
Server: nginx-rc
Date: Wed, 24 Oct 2018 05:46:25 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Location: http://myfitpicks.com/
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff

Did you configure a proper virtual host for the saddles domain, pointing to the right directory?

Oh! That is great information. How did you find that?

I setup the two “web apps” using runcloud. I am very new to this (obviously).

I setup the saddles domain with Apache+Nginx hybrid setup in runcloud. I did not touch the vhost at all as I’m not sure how to do that properly.

The missing virtual host is the reason why it hits the default host, the redirect to that host’s domain is then probably additionally configured.

You will need to configure a separate virtual host for the second domain and things should work.

Can you point me to any guides on how to do that?

The manual :), not familiar with that software

You are referring to Runcloud?

If that is the server, yes.

Oh, no. The domains are hosted on a single Vultr server. Runcloud is a server management software. Although not really sure I need it!

Thanks for the help! I’ll take a look into it and see what I can find.

As a slightly unrelated note, I setup domain1 with solely nginx server settings and domain2 with nginx and apache hybrid. Does this have any effect on how I edit the vhost files?

Just trying to wrap my head around all this lingo!

So Nginx is the webserver and Apache the proxy?

Honestly I have no idea. :neutral_face:

https://imgur.com/a/am9sbdI

I am considering switching them both to just nginx setups as I’m not sure I need access to htaccess…?

1 Like

.htaccess is just a “glorified” dynamic per-directory server configuration, not too much magic :slight_smile:

As mentioned I am not all that familiar with that piece of software, hence I can guess at best, but it really depends what they mean by hybrid configuration, and if it is a classic proxy setup, who is the proxy and who the server, respectively if the proxy also needs to know about virtual hosts or whether it simply passes everything through to the server.

Thanks for all the help @sandro. I finally ended up scrapping Runcloud as it was causing more problems than benefits. I then reinstalled my Vultr server and used EasyEngine for my Wordpress installations for both domains. Found this guide very helpful.

If you only have one IP on the server, I think your issue has to do with SSL.
It used to be ever site under SSL had to have it’s own IP address on the origin server.
SNI (server name indication) is the way around that. Can you confirm that is set up correctly in your website dns bindings?

1 Like

The problem was with HTTP as well.

Runcloud is like Serverpilot. And I know that Serverpilot lets you configure a Default Domain. So if you hit that IP address and/or the hostname doesn’t match, you get served the default domain’s website.

Here a blog post on that feature:

This topic was automatically closed after 31 days. New replies are no longer allowed.