Question

How to configure one load balancer with two domains

I’m building 2 droplets 1 for api and the other for web apps.How can i create 1 load balancer for both droplets that will per domain.

For example: droplet1.com - droplet2.com both on the same load balancer


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.

Hi there,

The main purpose of using a load balancer would be to load balance the traffic between two or more identical Droplets.

So for your case you would need to have your API and website’s content deployed on one Droplet and then replicate the content of that Droplet to another one as follows:

Load Balancing

If you want to have your API hosted on one Droplet and then your website on another Droplet, in this case, there will be no need for a load balancer.

Hope that this helps! Best, Bobby