NGINX as a Reverse Proxy
[ 78 ]
server {
location / {
proxy_pass http://app;
}
}
Using this configuration, NGINX will pass consecutive requests in a round-
robin fashion to the three upstream servers. This is useful when an application
can handle only one request at a time, and you'd like NGINX to handle the
client communication so that none of the application servers get overloaded.
The configuration is illustrated in the following diagram:
Other load-balancing algorithms are available, as detailed in the Load-balancing
algorithms section earlier in this chapter. Which one should be used in a particular
configuration depends on the situation.