Question

Load Balancer WIldcard but with one subdomain going to a different droplet

Right now I’m using an nginx VPS to terminate SSL (wildcard and naked domain), but to forward one specific subdomain to a different server. It works fine.

I’m wondering though if I can leverage DO’s load balancers for this instead of managing it myself.

I have a group of servers for my main app, which responds to a lot of different subdomains (like a thousand or so, one for each customer). I.e. a.example.com, b.example.com, etc.

I have a second group of servers running a different application which needs to respond to one specific subdomain (legacy.example.com).

I get how to configure the DO load balancers to handle #1 or #2 in a vacuum, but I can’t find a way to do both.

To summarize, what I need to do is:

  1. SSL Terminate *.example.com (via letsencrypt wildcard managed by the LB).
  2. Proxy just legacy.example.com to Droplet B.
  3. Proxy everything else *.example.com to Droplet A

So is there a way to write custom rules for the LB to handle this? Would having 2 LBs handle this? Or do I just stick with my current nginx VPS setup?


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.

Bobby Iliev
Site Moderator
Site Moderator badge
October 12, 2021
Accepted Answer

Hey @dave186771,

I believe that as of the time being adding custom load balancing rules is not possible with the Managed Load Balancers. But this sounds like it’d be super useful!

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

Hope that helps! - Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.