Speaking of Nginx, we all know that it can be used as a reverse proxy. So what exactly is a reverse proxy, and what is the equivalent of a forward proxy? This article will take you to understand. The reverse proxy is also an important part of the system architecture.

Speaking of agent, its essence can be understood as an intermediary. When A and B are not convenient to interact, an intermediate role C is often introduced, so C is the intermediary, is the agent.

Forward agent

A forward proxy server is usually located between the client and the server. It is similar to a jumper and can access the target server through the proxy server.

In forward proxy mode, usually, the client sends a request to the target server, and the proxy server forwards the request to the target server in the middle and returns the result to the client.

The forward proxy requires some special Settings on the client.

For example, when we want to access Google, but cannot access it directly, we need to request to the proxy server through a forward proxy server, and then the proxy server will access, and return the access results. In the eyes of customers, it is the equivalent of Google’s direct request.

Forward proxies are usually used in the following scenarios:

  • Accessing previously inaccessible resources, such as Google;
  • The buffering feature is used to reduce network usage and speed up resource access.
  • Client access authorization, Internet access authentication;
  • The proxy can record user access records (online behavior management).
  • Hiding the client identity (the target does not know who is behind it);

The reverse proxy

Reverse Proxy is the opposite of forward Proxy. The Proxy service resides on the server.

To the client, the reverse proxy server acts as the target server. The reverse proxy server receives the request from the client, sends it to the Intranet server, and returns the result returned by the Intranet server to the client.

The client is not aware of the service behind the reverse proxy and does not need any setup by the client. It only needs to treat the reverse proxy server as a real server.

Reverse proxy uses:

  • To protect and hide the original resource server from attacks, the reverse proxy is usually used as the public network access address and the Web server is the Intranet.
  • Load balancing, through the reverse proxy to optimize the server resources;
  • Encryption and SSL acceleration;
  • Caching static content;
  • Compression, slow down upload, security, extranet release, etc.

The difference between forward and reverse proxies

Classification of uses:

  • Forward proxy: The forward proxy is used to provide access to the Internet on the LAN inside the firewall.
  • Reverse proxy: The reverse proxy provides the server behind the firewall for Internet users to access.

Security distinction:

  • Forward proxy: Forward proxy allows clients to access any website through it and conceals the client itself, so security measures must be taken to ensure that only authorized clients are served;
  • Reverse proxy: It is transparent to the outside world and visitors do not know that they are accessing a proxy. To the visitor, it thinks it is accessing the original server.

Transparent proxy

Transparent proxy is similar to forward proxy. The client does not need to know about the existence of a proxy server. It changes your request fields and sends real IP addresses.

For example, for the sake of work efficiency or safety, COMPANY A blocks the use of QQ software. The company inserts a transparent proxy between the internal network and the external network, grabs the request content according to the rules, meets the QQ request to shield it, so as to complete the transparent shielding.

summary

The difference between a forward proxy and a reverse proxy is that the proxy object of a forward proxy is a client, while the proxy object of a reverse proxy is a server.

A proxy server on the client side is a forward proxy, and a proxy server on the original side is a reverse proxy.

Refer to the article: blog.csdn.net/u010454030/… Juejin. Cn/post / 684490… www.cnblogs.com/anker/p/605… Blog.csdn.net/qq_28988969… www.cnblogs.com/taostaryu/p…