Analysis of Nginx Reverse proxy service

Source: Internet
Author: User
Tags nginx server nginx reverse proxy

Nginx Reverse Proxy Service


The reverse proxy (reverse proxies) means using Proxy server to accept the Internet connection request, then will be asked to transfer to the internal network in the upstream server, from the upstream server to get back to the internet on the request to connect the client, at this time, The proxy server is a Web server on the outside of the table.

Nginx has a strong high and high load capacity, so generally as the front-end service server directly to the client to provide static file services, but also some complex, multi-variable business is not suitable for the Nginx server, this time with Apache,tomcat and other services to deal with.

Nginx is usually configured to be both a static Web server and a reverse proxy service, and the requests that are not suitable for nginx are directly transferred to the upstream server.

650) this.width=650; "style=" WIDTH:750PX;HEIGHT:309PX; "src=" http://s1.51cto.com/wyfs02/M02/7F/C8/ Wkiom1csrtjyviadaaf4a4ke7ea855.jpg "title=" Nginx as a static web and reverse proxy server "border=" 0 "height=" 309 "hspace=" 0 "vspace=" 0 "width = "alt=" "Wkiom1csrtjyviadaaf4a4ke7ea855.jpg"/>


When the client has an HTTP request, Nginx reverse proxy will not immediately transfer to the upstream service, but first to the user's request to fully accept the Nginx reverse Proxy service tray or memory, and then to the upstream server to connect, the cache of the client request to transfer to the upstream service device

650) this.width=650; "style=" width:750px;height:364px; "src=" http://s5.51cto.com/wyfs02/M00/7F/C6/ Wkiol1cstgojqachaaij2uqpnts967.jpg "title=" Nginx as reverse proxy service is the process of "border=" 0 "height=" 364 "hspace=" 0 "vspace=" 0 " Width= "alt=" "Wkiol1cstgojqachaaij2uqpnts967.jpg"/>


The advantages of this way of working:


missing point: Extended a request to handle the time, and increased the user to cache the contents of the memory and the magnetic tray space.


Advantage: Reduce the load of the upstream service, try to put pressure on the Nginx reverse proxy service.

why reduce the load on the upstream server?   

Typically, the network of client and agent services is more complex, mostly "go" public network, the average speed of the Internet may be slower, so a request may take a long time to complete. and the agent service and the upstream server is generally the Internet, or have an expert connection, transfer speed is faster. The reverse proxy service, such as squid, has established a connection to the upstream server when it connects to the client and does not start receiving HTTP packets. For example, if you want to upload a 1G file, each time the squid receives a TCP sub-packet (such as 2KB), it will turn to the upstream server, and in the process of receiving the client's complete HTTP package, the upstream service will eventually hold this connection, This is a direct challenge to the upstream server's ability to develop and
Nginx reverse proxy is different, it receives the full client request (such as 1G files), and the upstream server to establish a connection to the request, because it is the intranet, so this process will run quickly. In this way, a client asks for the connection time of the upstream service to be very short, that is to say, nginx this kind of reverse proxy solution is mainly to reduce the upstream service and the pressure

This article from "Meteor Yu" blog, declined reproduced!

Analysis of Nginx Reverse proxy service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.