Wind Letter Net (ithov.com) original article: This chapter mainly introduces Nginx configuration management and use. As a lightweight HTTP server, Nginx has the following advantages over Apache: In performance, it takes up very little system resources, supports more concurrent connections, and achieves higher access efficiency: In functionality, Nginx is a good proxy server and load-balancing server: On the installation configuration, Nginx installation is simple, flexible configuration. The following is a detailed description of the configuration and use of Nginx.
What is Nginx
I believe many readers are very familiar with Apache, Nginx is similar to Apache, is also a high-performance HTTP and reverse proxy Server software, or a IMAP/POP3/SMTP proxy server. Nginx (pronounced "Enginex") is developed by the Russian program designer Igor Sysoev (Igor publishes the source code in the form of a BSD-like license). Can run on Unix, GNU, BSD, Mac os X, Solaris, and Microsoft Windows, and other operating systems. With the wide use of nginx in many large websites, its stable and efficient features are increasingly recognized by more and more users.
Why Choose Nginx
Similarities and differences between Nginx and Apache
Nginx, like Apache, are HTTP gills software, in the realization of the function are modular structure design, support common language interface, such as PHP, Perl, Python, etc., but also support forward and reverse proxy, virtual host, URL rewrite, compressed transmission, SSL encryption transmission. The biggest difference between them is that the Apache processing speed is very slow, and occupy a lot of memory resources, and Nginx is exactly the opposite; in the implementation of the function, Apache all the modules support dynamic, static compilation, and Nginx modules are statically compiled, while, Apache support for fcgi is not good, and Nginx support for fcgi is very good: in the process of connecting the way, Nginx support Epoll. and Apache does not support: In space use, NGINX installation package only hundreds of K, and Nginx compared to Apache is absolutely leviathan. After understanding the similarities and differences between Nginx and Apache, we basically know the advantages of Nginx as an HTTP server.
The advantage of choosing Nginx
As you can see from the simple introduction above, the advantages of Nginx as an HTTP server are obvious, and there are many performance and advantages unmatched by other Web servers:
Port as a Web server, nginx processing static files, index files, automatic indexing is very efficient.
Port as a proxy server, Nginx can be implemented without caching the reverse proxy acceleration, improve the speed of the Web site.
Port as a load balancing server, Nginx can support both rails and PHP internally, as well as HTTP proxy Server services externally, while also supporting simple fault tolerance and leveraging algorithms for load balancing.
Port in terms of performance. Nginx is developed specifically for performance optimization and is highly efficient in implementation. It takes the kernel poll model, supports more concurrent connections, supports responses to 50 000 concurrent connections, and consumes very low memory resources.
In terms of stability, Nginx adopts a phased resource allocation technique, which makes the CPU and memory occupancy rate very low.
Nginx officials said that Nginx maintained 1O no active connection, and these connections only occupy 2.5MB memory, so the attack like DOS for Nginx is basically no effect.
Port in terms of high availability, Nginx supports hot deployment, which is particularly fast, so that you can upgrade the software version or configuration without interruption, even if it runs for months without restarting, and can be run almost 7x24.