Report this

What is the reason for this report?

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

Posted on March 6, 2019

So I have a main loader called:

kog-game-loader which uses a certificate

I want: thidomain.org to run one http server and test.thisdomain.org 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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

Jarland

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: web.xxx.com:443 -> loadbalancer (with SSL termination) -> droplet-1:80 api.xxx.com:443 -> 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.