Nginx reverse proxy server

Nginx Profile

Nginx (engine x) is a lightweight, high-performance, based on Http, the reverse proxy server, or a mail server.

Proxy Server

Depending on its proxy server proxy object can be divided into forward proxy server and reverse proxy server. Here the "positive" and "R" are standing on the client's point of view.

Forward Proxy

Forward proxy is a client of the agency. C client wants to obtain resources from the server S, but can not for some reason but to send a request to directly access the server through P to another host server. When the server processed the request, it sends a response to the host P, P in the host after receiving a response from the server, and the response transferred to the client C. At this point the host P, called client-side C of the forward proxy server. When the client is aware of the use of forward proxy server address and other information that the target server to be accessed. Forward Proxy user (client) to set up a host server, regardless of the server-side, forward proxy server appears, the server did not know the existence of a real client.

Why use a forward proxy server?

Forward Proxy common features are summarized as follows: 

(1) Hide

Visitors to hide the real server. Because, for the server, the real visitors, the real client is a forward proxy server, the server does not know the visitor forward proxy server. Therefore, the client played a hidden role. For example, many current telecommunications telephone fraud, are using a proxy server. We see the caller ID phone number, the phone number is not in fact true scammers use. Scammers are really dialed forward proxy server's phone and dialed our phone by the proxy server

(2) over the wall

For some reason, the client can not directly access server-side C S, C but the client can directly access the proxy server P, P and proxy servers can directly access the server S, so the client through a proxy server to server S P realization of visit, this technique is called "over the wall." For example, we want to "Google academic" download some papers, for policy reasons, we can not directly access Google. At this point, we might through some software over the wall, in the software we can access Google. However, before using the software, you need to enter the IP address of the forward proxy server we want to connect in the software, connect the server. Nginx reverse proxy server

(3) Speed

If the client access to the server directly, which is obtained by a low-speed network links, which access efficiency is low. But the client access another host P, P and access the host server, the link they are using a high-speed link. At this point, you can build these host P as a forward proxy server. By the efficiency of the proxy server to access the server, but also more efficient than direct access.

(4) caching reverse proxy server Nginx

If the client from the server to get the resource-based, you can add a forward proxy server has a cache function between the client and the server. When a client obtains a resource from the server, first check whether the proxy server resources. If the resource has, is acquired directly from the proxy server to the resource; if not having the resources, and then send the resource request to the server by the proxy server, the acquired resources, caching proxy server to forward, and returns to the clients. Later there are client submit the request for obtaining the resource, you can get directly from the proxy server. Not only to speed up the response time to clients, and enhance the user experience, but also reduce the pressure on the service side, the implementation of the overall system efficiency improvement.
The Nexus Maven PW is a typical for the "cache" function of the forward proxy server.

(5) Authorization

Typical applications are authorized, in the internal LAN, not all computers can all be connected to external networks. Then the company is how to achieve external network access to managed it? Between the corporate LAN and the external network to set up a firewall, and set permissions to connect to external networks within the corporate LAN in forward proxy server, add a new firewall rule namely, whether through the firewall to achieve.

Reverse Proxy

 

 

Reverse Proxy Reverse Proxy, is a proxy for the service side. From the point of view schematic diagram of a single function, like a reverse proxy and a forward proxy is no different, are set up in the host between the client and the server. However, the reverse proxy server is set up host, regardless of the end customer. The client believes that access the server itself, but it really is a reverse proxy server access. When the client using a reverse proxy server, simply do not know the address of the target server and the information you really want to visit, all access is done through a proxy. On this point forward proxy server is different.

(1) Hidden

The client can only access to the reverse proxy server, the client and the real server is not directly accessible. This served to protect and hide the real purpose servers.

(2) load balancing

When a client access a higher concentration, will produce high concurrency problems. For distributed server system, the reverse proxy functions according to the different request, forwards the request to the appropriate server; for the cluster server system, the reverse proxy server according to the loading amount of each of the requests to lightly loaded servers. These are played load balancing.

(3) separating movement

Refers to dynamic resource, resource requirements after calculating server code before formation. For example, JSP page is a dynamic resource, because the data page is queried by the server from the DB out. Static resource is a resource does not change, for example, page images, audio, video, CSS, JS files and other resources, are static resources. Reverse proxy server dynamic resource request directly isolated static resource request, it reduces the pressure application server.

(4) Data Cache

The reverse proxy also has a data cache function. For example, the static resource caching client requests to the proxy server. Further, when the same resource request, the resource can be acquired directly from the proxy server. 

Nginx features

1. high concurrency

2. low consumption

3. hot deployment

4 high scalability

5. High Availability

 

 

Guess you like

Origin www.cnblogs.com/wu-yi/p/12163188.html