Nginx Load Balancer Example Setup and Config

preview_player
Показать описание
Need to setup an Nginx load balancer and reverse proxy? This simple example will show you not only how to configure Nginx to balance requests across Tomcat, Apache, Express or Node based backend servers, but it will also show you how to weight servers in Nginx and even set up stick session for Nginx.

And what's amazing is how simple it all is. Just add an upstream entry, list your servers, set a weighting and then add the proxy_pass element and you'll have yourself an Nginx load balancer and reverse proxy.

This Nginx load balancer example does use Apache Tomcat as the backend server, but the Nginx configuration and setup is completely agnostic to where the requests get sprayed.
Рекомендации по теме
Комментарии
Автор

Tm I had a project where I wanted to build a load balancer. I found this tutorial, fast, and simple. Thanks, Man. Subscribed You!!

manojad
Автор

If i'm correct in this e example it's all in the same server right? how about multiple server? one for the load balancer and 2 or more for the app, you just replace localhost:8080, localhost:8081 etc by the different domains?

crashbdx
Автор

Thanks for the great video. I just have one problem. there is folder named sites-available in my nginx by default. should I make it myself or use nginx.conf or default.conf?

samansaeedi
Автор

what is the difference between conf.d configurations files and sites available config files?

husseiny
Автор

I am using an nginx instance in docker, and the "sites-available" directory is missing. Should I add this manually or what?

youssefwael