Over the weekend, I was searching online for resumes to recruit new people to my team. By this time, my girlfriend was back, not looking very happy.
Reverse proxy: A proxy server receives Internet connection requests, forwards the requests to the Intranet server, and returns the result to the Internet client. In this case, the proxy server acts as a reverse proxy server externally.
Forward agent
Forward agent (forward proxy) : is a is located in the client and server (proxy server), between the target server to get content from the target server, the client sends a request to the proxy server and specify the target, then the proxy server to the target server transfer request and will get back to the content of the client.
This kind of agent is actually quite common in life, such as scientific Internet technology, which uses the agent technology.
Sometimes, the user wants to access a foreign website that cannot be accessed directly in the country, but we can access a proxy server that can access the foreign website. In this case, the user’s access to the foreign site requires a proxy server to forward the request, and the proxy server will return the request response to the user. This process uses forward proxies.
The process is a lot like renting a house.
When renting a house, it is usually difficult to contact the landlord, because some landlords only give their house information and keys to the agent for convenience. Tenants who want to rent a house can only contact the landlord through an agent. As for the landlord, he may not know who is really renting his house, he only knows that the agent is contacting him.
There are three roles: tenant (user), broker (proxy server) and host (foreign site, target server). The reason for the introduction of intermediaries (proxy servers) is that users cannot contact their hosts (users cannot access foreign websites).
So, the forward proxy, the proxy server proxies the client to interact with the target server.
The forward proxy server accesses the target server, which does not know who the real client is, or even that it is being accessed by a proxy (sometimes posing as a tenant directly).
The use of forward proxies
Breaking access restrictions
Through the proxy server, you can break through its own IP access restrictions, access foreign websites, education networks, etc.
That is, the tenant can solve the problem of not being able to contact the landlord through the intermediary.
Increase access speed
Generally, the proxy server sets a large disk buffer and saves part of the response to the request in the buffer. When another user accesses the same information, the proxy server directly extracts the information from the buffer and sends it to the user to improve the access speed.
In other words, the agent keeps a lot of housing information and keys, and can directly take tenants to see the house.
Hide the real IP address of the client
Internet surfers can also hide their IP addresses from attack in this way.
That is, the landlord does not know the true identity of the tenant. PS: But the intermediary knows, and there may be more harassment… .
The reverse proxy
Reverse proxy: A proxy server receives Internet connection requests, forwards the requests to the Intranet server, and returns the result to the Internet client. In this case, the proxy server acts as a reverse proxy server externally.
In the process of renting houses, in addition to some houses need to be rented through the intermediary, and some can be directly rented by the landlord. The case where users directly find the landlord to rent a house is the case where we directly visit domestic websites without using agents.
Another situation is that we think we are dealing with the landlord, but sometimes it may not be the landlord himself, it may be his relatives, friends, or even the principal landlord. But what we didn’t know was that the person we were communicating with wasn’t the real landlord. The primary host that helps real homeowners rent is a reverse proxy server. This process is called reverse proxy.
For common scenario is that we in the Web development (principal) used in load balancing server, the client sends a request to load balancing server (tenant) (principal), the load balancing server (principal) put forward the request to a real server (the landlord) to perform, put the results returned to the client (tenant).

When accessing the target server through the reverse proxy server, the client does not know who the real target server is, or even that it is accessing a proxy.
Purpose of reverse proxy
Hide the real SERVER IP address
Using a reverse proxy, you can hide the IP address of the server from the client.
That is, the tenant does not know the real identity of the landlord.
Load balancing
The reverse proxy server can perform load balancing and distribute client requests to different real servers based on the load of all real servers.
That is, the principal landlord found the owner himself very busy, so he asked the owner’s wife to help deal with the rental matters.
Increase access speed
The reverse proxy server can cache static content and dynamic content that has a large number of access requests in a short time to improve access speed.
That is, the principal landlord also has the house information and keys.
Provide security
The reverse proxy server functions as an application-layer firewall to protect Web sites from web-based attacks, such as DoS and DDoS, making it easier to check malicious software. It also provides encryption and SSL acceleration (such as SSL terminal proxy) and HTTP access authentication for back-end servers.
That is, the primary landlord can effectively protect the safety of the landlord.
The difference between forward and reverse proxies
Although the forward proxy server and reverse proxy server are located between the client and the real server, and do what the client requests to the server, the server response to the client, but there are some differences between the two.
1. A forward proxy is actually a proxy for the client, helping the client access server resources that it cannot access. Reverse proxy is the proxy of the server, helping the server to perform load balancing and security protection.
2. Forward proxy is usually installed by the client, such as installing a proxy software on your own machine. A reverse proxy is usually deployed on a server. For example, a reverse proxy server is deployed on a cluster of hosts.
3. In forward proxy, the server does not know who the real client is and thinks that the client accessing it is the real client. In a reverse proxy, the client does not know who the real server is and thinks it is the real client it is accessing.
4. The roles and purposes of forward and reverse proxies are different. Forward proxies are mainly used to solve access restriction problems. Reverse proxy provides load balancing and security protection. Both can improve access speed.