Nginx concept

Wikipedia basically defines nginx

What is Nginx?

Nginx is a high-performance HTP server/reverse proxy server and email (IMAP/POP3) proxy server. Nginx was officially tested to support 50,000 concurrent links with very low CPU, memory and other resource consumption.

Main usage scenarios of nginx

  • High-performance Web server

    Nginx is an HTTP service that can provide HTTP services independently. Can do web static server, but also support 50000 concurrent connections, its characteristics is also very low CPU and memory usage, 10000 inactive connections only take up 2.5m memory.

  • Reverse proxy server

    • Forward agent

    Configure the information about the proxy server in the browser to access the target website through the proxy server. After receiving the response from the target website, the proxy server will return the response information to the browser client

    • The reverse proxy

    The browser client sends the request to a reverse proxy server (such as Nginx), which selects the original server to provide the service for the result response, and ultimately returns it to the client browser

  • Load balancing server

If a single server cannot meet users’ requests when the number of visits reaches a certain level, multiple server clusters can be used as reverse proxies. In addition, multiple servers can evenly share the load, so that a server is not idle due to the high load of a server downtime. Load balancing is designed to solve the problem of high load.

  • Dynamic and static separation

Key features of Nginx

  • High concurrency, high performance

  • Low memory consumption

  • Extensible, NGINx has a modular design that allows third party development

  • Cross-platform: Nginx can compile and run on most Unix-like operating systems, and Windows versions are also available

  • Nginx is very easy to get started with and relatively simple to configure

  • Good stability, low downtime probability

  • Nginx is an asynchronous, non-blocking, event-driven model

  • Hot deployment

Nginx vs. Apache

As you can see from the figure above, Nginx is good at reverse proxies, Rewrite rules, stability, static file handling, memory consumption, etc.