Question

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

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?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

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

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