Home  >  Article  >  Operation and Maintenance  >  What nginx can do

What nginx can do

(*-*)浩
(*-*)浩Original
2019-11-01 11:56:354302browse

This article only focuses on what Nginx can handle without loading third-party modules. Since there are too many third-party modules, it cannot be fully introduced. Of course, this article itself may not be complete.

What nginx can do

Reverse proxy (Recommended learning: nginx tutorial)

The reverse proxy should be done by Nginx The most common thing is, what is a reverse proxy? Here is what Baidu Encyclopedia says: The reverse proxy (Reverse Proxy) method refers to using a proxy server to accept connection requests on the Internet, and then forwarding the requests to the internal network server on the server, and returns the results obtained from the server to the client requesting a connection on the Internet. At this time, the proxy server appears as a reverse proxy server to the outside world.

To put it simply, the real server cannot be directly accessed by the external network, so a proxy server is needed. The proxy server can be accessed by the external network and is in the same network environment as the real server. Of course, it is also possible. It's the same server, just different ports.

Load balancing

Load balancing is also a commonly used function of Nginx. Load balancing means to allocate execution to multiple operating units, such as Web servers and FTP servers. , enterprise key application servers and other mission-critical servers, etc., so as to complete the work tasks together.

To put it simply, when there are 2 or more servers, requests are randomly distributed to the designated server for processing according to the rules. Load balancing configuration generally requires the configuration of a reverse proxy at the same time, and the reverse proxy jumps through the reverse proxy. Go to load balancing. Nginx currently supports 3 built-in load balancing strategies, as well as 2 commonly used third-party strategies.

HTTP server

Nginx itself is also a static resource server. When there are only static resources, you can use Nginx as the server. It is also very popular now. Separation can be achieved through Nginx.

Separation of dynamic and static

Separation of dynamic and static is to allow dynamic web pages in dynamic websites to distinguish constant resources from frequently changing resources according to certain rules. Dynamic and static resources do After splitting, we can cache the static resources according to their characteristics. This is the core idea of ​​static processing of the website

Forward proxy

Forward proxy means a server between the client and the origin server. In order to obtain content from the origin server, the client sends a request to the proxy and specifies the target (origin server), and then the proxy forwards it to the origin server. Request and return the obtained content to the client. Only clients can use forward proxies.

When you need to use your server as a proxy server, you can use Nginx to implement forward proxy. However, Nginx currently has a problem, that is, it does not support HTTPS.

The above is the detailed content of What nginx can do. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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