1. Preface
Recently work with the reverse proxy, found that network agents play a lot, there is a lot of network behind the need to learn. Before this only used the agent software, once in order to visit Google, using the agent software, you need to configure the proxy address in the browser. I only know that there is an agent of the concept, not clear that the agent also has positive and negative points, so hurriedly study, to supplement knowledge. First figure out what is a forward proxy, what is a reverse proxy, and then what is the way the two are displayed in actual use, and finally summarize what the forward proxy is used to do, what the reverse proxy can do.
2, the forward agent
A forward proxy is similar to a springboard machine, which proxies access to external resources.
As an example:
I am a user, I cannot access a website, but I can access a proxy server, this proxy server, he can access the site I can not access, so I first connected to the proxy server, told him I need the content of the site can not access, proxy server to fetch back, and then return to me. From the point of view of the site, only in the proxy server to fetch the content when there is a record, sometimes do not know the user's request, but also hide the user's information, depending on the agent does not tell the site.
The client must set up a forward proxy server, if you know the IP address of the forward proxy and the port of the agent.
For example, previously used software such as ccproxy,http://www.ccproxy.com/need to configure the proxy address in the browser.
In summary, the forward proxy is a server between the client and the originating server (Origin server), in order to obtain the content from the original server, the client sends a request to the agent and specifies the target (the original server). The agent then forwards the request to the original server and returns the obtained content to the client. The client must make some special settings to use the forward proxy.
The purpose of the forward proxy:
(1) Access to resources that were not previously accessible, such as Google
(2) caching can be done to speed up access to resources
(3) Authorization for client access, online authentication
(4) The agent can record the user access record (Internet behavior Management), the external hidden user information
For example Ccproxy use:
3. Reverse Proxy
The first contact direction agent feeling is that the client is the presence of a non-aware agent, the reverse proxy is transparent to the outside, visitors do not know that they are visiting an agent. Because the client does not need any configuration to access it.
The reverse proxy (Reverse proxy) is actually run as a proxy server to accept connection requests on the Internet, then forwards the request to a server on the internal network and returns the results from the server to the client requesting a connection on the Internet. At this point the proxy server is represented as a server externally.
The role of the reverse proxy:
(1) To ensure the security of the intranet, you can use the reverse proxy to provide WAF capabilities to prevent web attacks
Large web site, usually the reverse proxy as a public access address, Web server is the intranet.
(2) Load balancing to optimize Web site load through reverse proxy server
4. Difference between the two
Borrowed from two pictures to express: https://www.zhihu.com/question/24723688
5, Nginx's reverse proxy
Nginx supports configuring the reverse proxy to load balance the website through reverse proxy. This part first write a nginx configuration, the subsequent need to delve into the Nginx proxy module and load balancer module.
Nginx through Proxy_pass_http configuration proxy site, upstream to achieve load balancing.
Resources:
http://z00w00.blog.51cto.com/515114/1031287
http://blog.csdn.net/m13666368773/article/details/8060481
Forward proxy vs. reverse proxy "Summary"