1, the preface
Recently, I used reverse proxy in my work, and found that there are many ways to play network proxy. There are a lot of things to learn behind the network. Before this, I only used proxy software. In order to access Google, I used proxy software and needed to configure the proxy address in the browser. I only know the concept of agent, not clear agent and positive and reverse points, so quickly learn, add knowledge. First, make clear what is a forward proxy and what is a reverse proxy, and then show how they are used in practice. Finally, summarize what a forward proxy is used for and what a reverse proxy can do.
2. Forward proxy
A forward proxy is like a jump board in that the proxy accesses external resources.
Here’s an example:
I am a user, I can’t visit a web site, but I can visit a proxy server, the proxy server, he can access that I can’t access the website, so I even on a proxy server first, tell him I need that can not visit the web site content, the proxy server to get back, and then return to me. From the site’s point of view, only once is recorded when the proxy server comes to pick up the content, sometimes without knowing it is the user’s request and hiding the user’s information, depending on whether the proxy tells the site or not.
The client must set up the forward proxy server, of course, if you know the IP address of the forward proxy server, and the port of the proxy program.
For example, if you have used CCproxy before, www.ccproxy.com/ needs to configure the proxy address in the browser.
To sum up: a forward proxy is a server located between the client and the origin server. In order to get content from the origin server, the client sends a request to the proxy and specifies the target (the origin server). Then the proxy forwards the request to the original server and returns the obtained content to the client. Clients must make some special Settings to use forward proxies.
Forward proxy uses:
(1) Access previously inaccessible resources, such as Google
(2) Can do cache, speed up access to resources
(3) Authorize client access and authenticate Internet access
(4) The agent can record user access records (online behavior management) and hide user information externally
For example, CCProxy uses:
3. Reverse proxy
The first contact with the directional proxy is that the client is not aware of the existence of the proxy, the reverse proxy is transparent to the outside world, visitors do not know that they are accessing a proxy. Because the client doesn’t need any configuration to access it.
The actual operation mode of Reverse Proxy refers to that the Proxy server receives Internet connection requests, forwards the requests to the server on the internal network, and returns the results obtained from the server to the client requesting Internet connection. In this case, the proxy server behaves as a server.
Reverse proxy functions:
(1) To ensure Intranet security, you can use the reverse proxy to provide the WAF function and prevent Web attacks
For large Web sites, the reverse proxy is used as the IP address of the public network, and the Web server is the Intranet.
(2) Load balancing, through the reverse proxy server to optimize the load of the website
4. The difference between the two
Borrow zhihu two graphic expression: www.zhihu.com/question/24…
5, nginx reverse proxy
Nginx supports reverse proxy configuration to implement load balancing on web sites. This part first write a nginx configuration, then need to in-depth study of nginx proxy module and load balancing module.
Nginx uses proxy_pass_http to configure proxy sites while upstream implements load balancing.
References:
Z00w00.blog.51cto.com/515114/1031…
Blog.csdn.net/m1366636877…
Suricata one of the packet capture methods AF_PACKET
» Next up:
Core dump on Linux