【Reverse proxy】Reverse proxy and its function

Reverse proxy and its role

1. What is a forward proxy

Before introducing reverse proxy, let's introduce what is forward proxy

The first thing to be clear is that the forward proxy in the http protocol is generally called a proxy . In web services, we can send requests by actively configuring the proxy server and receive the server's response through the proxy server. This process is determined by yourself, and you actively use the proxy to access other services.

insert image description here

Why do you want to do this?

Forward proxies can be used in many ways. For example, our common campus network and educational administration system are forward proxies, which can be accessed by mounting the school’s proxy server address, which can facilitate the school’s control of visitors.

Or for the purpose of access acceleration, configure some page caches in the proxy server in advance, so that we can quickly access pages through the proxy server.

2. What is a reverse proxy

Forward proxies are configured by users, while reverse proxies are configured by web service developers. Developers protect their IP addresses from being exposed by configuring a proxy to accept requests.

insert image description here

In this way, the user will not display the real address when sending the request, but will send it to the proxy address, and then the proxy server will send it to the real web server.

Usually load balancing can also be configured through a reverse proxy

What is load balancing?

In cluster mode , web developers can configure many servers and configure port repeating services on each server to improve throughput and concurrency . And when we start these servers and ports, there will be some problems. What should users do if they don't know these ports and server addresses? What if there are still many people accessing a port after knowing it? These situations may cause a large number of requests to enter the server, causing the server to fail to process and crash.

However, we can centrally manage these addresses by configuring the reverse proxy, and the reverse proxy server decides which addresses to visit, so as to ensure the load balance of each address and avoid the situation of overwhelming the service.
insert image description here

3. The role of reverse proxy

Safety

Through the above introduction, the reverse proxy can prevent the server's IP from being exposed to direct attacks. The attacker can only see the information on the proxy server, but cannot know the real data resources in the service. Even if it suffers a large-scale attack, it will only cause problems on the reverse proxy server and will not affect the real business system.

speed up

Like the forward proxy, web developers can also cache static resources in the reverse proxy server, and visitors will directly access the page through the cache, reducing the pressure on the static resource server and improving access speed.

Guess you like

Origin blog.csdn.net/qq_51383106/article/details/131737932