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
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!
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:

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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.