Question

How to set up load balancer with SSL?

  • Posted on March 29, 2014
  • laAsked by la

I currently have a single server with a Django stack. I have nginx with an SSL certificate for HTTPS. I want to scale the web layer by putting an nginx load balancer in front, and adding IP addresses to the upstream module config as I spin up new droplets to handle the load. Pretty straightforward to set up, but I can’t figure out how to make it work with SSL enabled. I tried the following:

  1. Enabled SSL in both the load balancer droplet and each one of the web app droplets. This doesn’t work because the SSL certificate in the web app droplets was created with a specific domain name. The load balancer fails to connect to the web app because it can’t verify the SSL certificate because it is using an IP address and not a FQDN, e.g 1.2.3.4 not web1.example.com

  2. Then I tried enabling SSL only on the load balancer. The load balancer can communicate via HTTP with the web app droplets, but then that traffic would not be secure over a public network.

I’m at a loss. Could you provide some advice in how to proceed? Do I need to set up a private network between the load balancer and the web app droplets? If so, how? Is there any other techniques using SSL certificates, or DNS configuration settings perhaps?

Any help would be appreciated! BTW I’m using Ubuntu 12.10 x64

Thanks!

LA


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.

Did anybody find the solution ? Kindly share it . I am having the same problem . @la @kamaln7 @emmas

I seems like combining both would be the best. Thanks @kamal I will give it a try.

You can set up SSL only on the load balancer and communicate with the app droplets via HTTP over the private network (see <a href=“https://www.digitalocean.com/community/articles/how-to-set-up-and-use-digitalocean-private-networking”>https://www.digitalocean.com/community/articles/how-to-set-up-and-use-digitalocean-private-networking</a>). <br> <br>If you still want to use SSL on all of the droplets including the app droplets, you can create a self-signed SSL cert with the app droplet’s IP address as the Common Name instead of the hostname.