What is 1.Nginx?
Nginx is a high-performance HTTP and reverse proxy Server software, the first open source version was born in 2004, although the birth later but after more than more than 10 years of development, has become very popular Web server software, is W3techs published the global Web server Software Statistics report
Why is 2.Nginx popular?
First of all, Nginx features to meet the trend of the market, in recent years, with the reduction of hardware costs, personal computers and mobile devices have been popularized, high concurrent traffic has become a site must deal with the problem. Nginx is for performance, since the release has been focused on high-performance, high concurrency, low CPU memory consumption; In terms of functionality: Load balancing, reverse proxy, access control, thermal deployment, high scalability and other features are well suited to modern network architectures. More valuable is the configuration of simple document rich, greatly reducing the threshold of learning.
What do 3.Nginx and Apache have in common?
-
- The same is the HTTP server software, all using modular structure design
-
- Supports common language interfaces such as Php,python, etc.
-
- Supports forward proxy and reverse proxy
3.4. Support virtual host and SSL encrypted transmission
3.5. Support Cache and compression transfer
3.6. Support URL Rewriting
3.7. Multi-module, strong extensibility
3.8. Multi-platform Support
Advantages of 4.Nginx
4.1 Lightweight installation files small runtime CPU memory usage is low
4.2 High performance support multi-core, processing static file efficiency, the kernel adopts the poll model can support 50K concurrent connection
4.3 Support for hot deployment at the same time fast, can upgrade the software and configuration in the case of uninterrupted service
4.4 Load balancing supports fault tolerance and health checks
4.5 Proxy features powerful support for non-cached reverse proxies while supporting IMAP/POP3/SMTP agents
The disadvantage of 5.Nginx
5.1 Less than Apache modules, common modules are available, and LUA language extensions are supported
5.2 Support for dynamic requests is less than Apache
5.3 Windows Edition features limited functionality, limited by Windows features, support for best or *unix systems
The composition of Nginx
Nginx's various functions and operations are implemented by the module. The Nginx module is divided into the core module, the basic module and the third party module from the structure.
核心模块: HTTP模块、EVENT模块和MAIL模块基础模块: HTTP Access模块、HTTP FastCGI模块、HTTP Proxy模块和HTTP Rewrite模块第三方模块: HTTP Upstream Request Hash模块、Notice模块和HTTP Access Key模块及用户自己开发的模块
This design makes nginx easy to develop and expand, making Nginx function so powerful. Nginx module is compiled into Nginx by default, if you need to add or remove modules, you need to recompile nginx, which is not as convenient as the dynamic loading module of Apache.
Schema used by Nginx
Lnmp
The most popular and classic environment in web history is lamp (Linux + Apache + Mysql + PHP), there are still a large number of sites using this architecture, Apache default configuration in the case of not optimized to use CPU and memory. With Nginx's light weight and high performance, the LNMP architecture simply replaced the Apache in the lamp environment with Nginx, and another classic Lnmp architecture was born. LNMP The server hardware configuration, compared to lamp will use less CPU and memory, is small website, low server, and the Gospel of VPS.
Of course, Nginx has other architectures, but in the subsequent articles, I will only use this structure, so the other is not listed in the description.
Initial knowledge of Nginx in "Linux Nginx Combat" (I.)