Can I have multiple subdirectories on one Load Balancer pointing to various targets?

Posted September 9, 2021 193 views
Load Balancing

Can I have a Load Balancer (configured as a reverse proxy) to handle multiple paths/subdirectories, for example: -> droplet:3000 -> app -> external IP

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.

Submit an Answer
1 answer

Hi there,

I believe that this is not yet doable with the Managed Load balancers. For layer 7 load balancing, you could use HAProxy. You can install it on a Droplet and configure it to your exact needs.

Here is a very good tutorial that covers this and also includes an introduction to Layer 7 Load Balancing:

Hope that this helps!

by Mitchell Anicas
An introduction to basic load balancing concepts and terminology, using HAProxy, with some examples.
  • Hi Bobby,

    That makes sense, so I would use:

    1) a Load Balancer to provide me with an SSL certificate and DDoS protection
    2) a HAProxy inside of a Droplet that will be accessible only through the Load Balancer in #1

    If I run out of resources in the HAProxy droplet, I can scale it vertically or horizontally, configuring each instance identically (and the Load Balancer will split traffic between them)

    The configuration of HAProxy needs to be done by SSH-ing into the Droplet.

    Is my assumption correct?

    • Hi there Tom,

      Yes indeed, this sounds all correct!

      Just one remark, I think that the Managed Load balancer does not come with DDoS protection, but as a suggestion, you could also add Cloudflare as a CDN + DDoS protection service.

      Cloudflare also provides you with an out-of-the-box SSL certificate so that you would not have to implement this on your Load Balancer level.