1. What is Nginx What is the role of Nginx

[]Introduction to [Nginx]

Official website: https://nginx.org/

Nginx (engine x) is a high-performance HTTP and [reverse proxy] is a high-performance HTTP and [reverse proxy] web server that also provides IMAP/POP3/SMTPservices. Nginx was developed by Igor Sesoyev for the second most visited site in Russia, Rambler.ru (Russian: Рамблер), and the first public version 0.1.0 was released on October 4, 2004. On June 1, 2011, nginx 1.0.4 was released.

It releases the source code under a BSD-like license and is known for its stability, rich feature set, simple configuration files, and low consumption of system resources.

Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server, released under the BSD-like protocol. Its characteristics are that it occupies less memory and has strong concurrency capability. In fact, the concurrency capability of nginx is better among web servers of the same type. Users of nginx websites in mainland China include: Baidu, JD.com, Sina, NetEase, Tencent, Taobao, etc.

Nginx is a service with very simple installation, very concise configuration file (also supports perl syntax), and very few bugs. Nginx is very easy to start and can run almost 24/7 without restarting even if it runs for several months. You can also upgrade software versions without interruption of service.

Nginx code is completely written from scratch in C language. Official data tests show that it can support responses up to 50,000 concurrent connections.

Nginx role

reverse proxy

Reverse proxy ( Reverse Proxy ) means that the proxy server accepts the client’s connection request, then forwards the request to the server on the internal network, and returns the result obtained from the server to the client. At this time, the proxy server externally Acts as a reverse proxy server.

load balancing

Load balancing is also a commonly used function of Nginx. Load balancing means that it is allocated to multiple operation units for execution. To put it simply, when there are two or more servers, requests are randomly distributed to the specified servers for processing according to the rules. Generally, the load balancing configuration requires a reverse proxy to be configured at the same time, and the reverse proxy is used to jump to the load balancing. Nginx currently supports 3 load balancing strategies and 2 commonly used third-party strategies.

For example : when we visit www.baidu.com , we actually visit not the same server each time

HTTP server (motion and static separation)

In our software development, some requests need to be processed in the background, and some requests do not need to be processed in the background (such as: css, html, jpg, js, etc. files). These files that do not need to be processed in the background are called static document. Let the dynamic web pages in the dynamic website distinguish the constant resources from the frequently changing resources according to certain rules. After the dynamic and static resources are divided, we can cache them according to the characteristics of the static resources. Improve the speed of resource response.

forward proxy

Forward proxy, meaning a server between the client and the origin server, in order to get the content from the origin server, the client sends a request to the proxy and specifies the target (origin server), and then the proxy forwards to the origin server Request and return the obtained content to the client. The client can use the forward proxy. When you need to use your server as a proxy server, you can use Nginx to implement forward proxy.

Leave a Comment

Your email address will not be published. Required fields are marked *