Question

Load balancer for NodeJS servers which running on port 3000

I have two servers running on port 3000. I’d like to have the load balancer to run on HTTPS and forward the request to those servers on port 3000.

I’m trying to setup a load balancer but not sure about the forwarding rules I should use because the UI of forwarding rules has limitation.

Any help would be much appreciated. Thanks!


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,

What I would usually do is the following:

  • Add a port 443 / HTTPS rule on the Load Balancer to forward the traffic to port 3000 on your specific Droplet where you have your node service running on.
  • Then create a HTTP to HTTPS redirect on your Load Balancer as described here:

https://www.digitalocean.com/docs/networking/load-balancers/how-to/ssl-termination/#force-ssl-traffic

That way if someone visits your site over HTTP they will first be redirected to HTTPS and the Load Balancer will handle the SSL termination.

Let me know if you have any questions.

Best,

Bobby