Why use Nginx reverse proxy

(*-*)浩
Release: 2019-11-01 11:34:09
Original
4591 people have browsed it

Why nginx reverse proxy can reduce the load on the upstream server.

Why use Nginx reverse proxy

Generally speaking, the public network has high latency. The request connection between the client and nginx goes through the public network, and nginx first Cache these requests, and wait for all the request data to be completed before nginx makes a request to the intranet server, which reduces the cost of public network delay and also reduces the time a connection takes up the server program. (Recommended learning: nginx tutorial)

Reason:

Because tcp may not be able to transmit all the data at once, so one connection may It takes a long time to transmit all the required data, and if such idle connections are directly connected to the server, it will increase the burden on the server. And nginx has made great optimizations in this regard and can carry more With multiple connections, idle connections will not occupy too much memory, so nginx as a reverse proxy can reduce the load on the upstream server.

Reverse proxy: Reverse proxy (ReverseProxy) refers to using a proxy server to accept connection requests on the Internet, and then forwards the request to the server on the internal network, and The results obtained from the server are returned to the client requesting a connection on the Internet. Simply put, the real server cannot be directly accessed by the external network, and access must be through a proxy.

The role of reverse proxy

1. Prevent the main server from being maliciously attacked

2. Provide implementation support for load balancing and dynamic and static separation

The reason why nginx is widely used, I think, is due to its flexible configuration. One nginx.conf file solves most problems, whether it is nginx creating a virtual server, nginx reverse proxy server, or nginx load balancing. Almost everything is done in this configuration file.

The server is only responsible for setting up nginx and running it. Moreover, it is lightweight and can achieve better results without occupying too many server resources. It is a very highly recommended server

The above is the detailed content of Why use Nginx reverse proxy. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!