What is Reverse Proxy and Load Balancing in Nginx / Web Server Terms?

These are two phrases that I hear very often, mainly related to Nginx. Can anyone give me a fight?

+5
source share
4 answers

Definitions are often difficult to understand. I think you just need an explanation to use them.

Brief explanation: load balancing is one of the functions of the reverse proxy, and the reverse proxy is one of the software tools that can perform load balancing.

And the long explanation below is explained.

For example, your company’s service has customers in the UK and in German. Since the policies are different for the two countries, your company has two web servers, uk.myservice.com for the UK and de.myservice.com for German, each with a different business logic. In addition, your company wants only one single endpoint for this service, myservice.com. In this case, you need to configure the reverse proxy server as a single endpoint. The proxy server accepts the url myservice.com and rewrites the URL of incoming requests so that requests from the UK (defined by the ip source) go to uk.myservice.com and requests from the German language go to de.myservice.com. From a UK client’s point of view, he never knows that the answer is indeed created on uk.myservice.com.

In this case, loading the request traffic to the service is actually balanced for the servers on uk.myservice.com and de.myservice.com as a side effect. Thus, we usually do not call it used as a load balancer, we simply say it as a reverse proxy.

But let's say whether your company uses the same policy for all countries and has 2 servers, a.myservice.com and b.myservice.com, only for the reason that the workload is heavy for one server. In this case, we usually refer to the reverse proxy server as a load balancer to emphasize the reason it is used.

+12
source

Here is a basic definition:

A reverse proxy is a proxy server that receives requests from a client and sends it to one of the servers behind it. Nginx and apache httpd are commonly used as reverse proxies. They are located in the administrative network of the web server on which the server requests a request.

This is different from the proxy server (forward) , which is in front of the client and sends requests on behalf of the client to the web server. For example, your corporate network translator is a direct proxy server. They are located in the administrative network of the client, where the request comes from.

Load balancing is a function performed by reverse proxies. Client requests are received by the load balancer, and the load balancer tries to send this request to one of the nodes (hosts) in the server pool, trying to balance the load on the various nodes.

+2
source

I see them as the functionality of an HTTP / Web server.

The task of load balancing is to distribute the workload between the node servers in the way that makes the best use of it.

A reverse proxy is an interface for the outside world, a request to be forwarded to a node server (even if we have one node) Its other use cases are caching of static content, compression, etc.

0
source

In the simplest case:

A reverse proxy receives a request from a client, redirects it to a server that can execute it, and returns a server response to the client.

A load balancing distributes incoming client requests among a group of servers, in each case it returns a response from the selected server to the corresponding client.

But they sound pretty similar, right? Both types of applications are between clients and servers, accept requests from the first and deliver responses from the latter. Unsurprisingly, this is a confusion regarding reverse proxy and load balancing. To help tease them apart, let's explore when and why they are usually deployed to a website.


Load balancing


Load balancers are most often deployed when a site requires multiple servers, because the volume of requests is too large for one server to work efficiently. Deploying multiple servers also resolves one error, making the site more reliable. Most often, servers contain the same content, and the task of balancing the load is to distribute the workload in such a way as to maximize the use of each server capacity, prevent overload on any server and provide a quick response to the client.

Reverse proxy

While deploying a load balancer only makes sense when you have multiple servers, it often makes sense to deploy a reverse proxy server even with one web server or application server. You can think of a reverse proxy server as the “public face” of websites. Its address is the one advertised for the website, and it is at the edge of the network of sites to receive requests from web browsers and mobile applications for content hosted on the website.

more details ...

0
source

Source: https://habr.com/ru/post/1207088/


All Articles