Forward proxy and reverse proxy

2. Forward proxy

  The forward proxy is like a springboard, and the proxy accesses external resources.

The purpose of forward proxy:

(1) Access previously inaccessible resources, such as google

(2) Cache can be used to speed up access to resources

(3) Authorize client access and authenticate the Internet

(4) The agent can record user access records (Internet behavior management) and hide user information from the outside world

 

3. Reverse proxy

  The feeling of contacting the direction proxy for the first time is that the client is unaware of the existence of the proxy, the reverse proxy is transparent to the outside world, and the visitor does not know that he is accessing a proxy. Because the client can access without any configuration.

  The actual operation mode of Reverse Proxy means that the proxy server accepts the connection request on the internet, then forwards the request to the server on the internal network, and returns the result obtained from the server to the client requesting the connection on the internet. At this time, the proxy server behaves as a server to the outside world.

The role of reverse proxy:

(1) To ensure the security of the intranet, reverse proxy can be used to provide WAF function to prevent web attacks

For large websites, the reverse proxy is usually used as the public network access address, and the web server is the intranet.

(2) Load balancing, optimize the load of the website through the reverse proxy server

 

 

4. The difference between the two

Borrow the two pictures of Zhihu to express: https://www.zhihu.com/question/24723688

5, nginx reverse proxy

   Nginx supports the configuration of reverse proxy, and realizes load balancing of website through reverse proxy. This part first writes an nginx configuration, and then needs to study the proxy module and load balancing module of nginx in depth.

nginx configures proxy sites through proxy_pass_http, and upstream achieves load balancing.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325075880&siteId=291194637