DevOps Daily: nginx load balancing #shorts

preview_player
Показать описание
What happens if we use the nginx proxy_pass directive to point to a stream of multiple servers? #shorts
Рекомендации по теме
Комментарии
Автор

Using the proxy_pass directive with a stream consisting of multiple servers will cause nginx to load balance all requests over the servers listed.
You'll also notice the least_conn directive in the stream configuration. This tell nginx to route an incoming request to the server with the least number of connections. You can also configure it to use sticky sessions as well as several other load balancing algorithms.

DevOpsForDevelopers
Автор

thanks!
im newbie in ngnix but these contents are worth the time to think.

zahrasalehi
Автор

Are all of the backends running the exact same software? And how would I just load a single backend if my site was small enough?

bryceblazegamingyt
Автор

wait, i thought 'stream' was for non-http traffic. Surely you just want an 'upstream' block insdie the http block not in a separate stream block, since i assume it's http traffic you want to load balancer, not just generic tcp/udp traffic (which is what 'stream' is for)

rinket