Can I have two different domains point to same loader, but load different websites?

Posted March 6, 2019 3.3k views
UbuntuLoad Balancing

So I have a main loader called:

kog-game-loader which uses a certificate

I want: to run one http server and to run another

Both of them going through the same loader and having a certificate.

EDIT: Sorry, the servers would run on two different droplets as well.

Is this possible?

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
3 answers

Hey friend,

This is fine but you would need a virtual host (Apache) / server block (Nginx) on each server that routes the traffic for the requested website. You can do this:

- Load Balancer
-- Droplet 1
---- Site 1
---- Site 2
-- Droplet 2
---- Site 1
---- Site 2

But you can’t do this reasonably:

- Load Balancer
-- Droplet 1
---- Site 1
-- Droplet 2
---- Site 2

These may help you in configuring the web server for it:


by Brennen Bearnes
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 16.04 server.

I don’t use apache nor nginx, I just use straight up Node.js

Hello, @jarland.

You say I can route 2 different domains through 1 loadbalancer?
I don’t think you can do that..

What I wanted is: -> loadbalancer (with SSL termination) -> droplet-1:80 -> loadbalancer (with SSL termination) -> droplet-1:80

The thing is that it doesn’t let me have 2 rules with the same port.
I can only understand this if the routing is done in layer 4, but if routing is done in layer 7 (which is HTTP layer), it should be able to map the domain names to the correct rules.