Why is Nginx the most popular web server

Data released by W3 shows that Nginx ranks first in the global web server market share with 33.0%, and Apache ranks second with 31.6%. Nginx is a widely used open source web server software, a project initiated by Igor Sysoev in 2002 and officially released in October 2004. It was originally created to solve the problem of C10k, which was defined as the challenge of managing ten thousand connections simultaneously.

Introduction to Nginx

Nginx is now part of F5 Networks, which was completed by F5 in 2019 to help them evolve from a hardware company to a more service-centric company.

Initially, Nginx was only used for HTTP web services. Today, Nginx can also act as a reverse proxy for IAMP, POP3 and SMTP, HTTP load balancer, media streaming and email proxy. Nginx has long been one of the go-to web servers for handling high-traffic websites because of its ability to handle large numbers of connections at breakneck speeds.

Advantages of Nginx

Nginx can be effectively extended as a web server and reverse proxy. It does not allow assigning a process to a specific connection, but creates a pool of processes that can be easily shared among multiple connections within the network. Whenever a request is made, resources are allocated to the process, resulting in improved resource utilization, making it easy to handle large numbers of connections.

  • Compared with Apache, Nginx uses less resources, supports more concurrent connections, and reflects higher efficiency, which makes Nginx especially popular with web hosting providers. Able to support the response of 50,000 concurrent connections, Nginx chose epoll as the development model.
  • As a load balancing server, Nginx can directly support Rails and PHP internally, and can also support external services as an HTTP proxy server. Nginx is written in C, which is much better than Perlbal in terms of system resource overhead and CPU usage efficiency.
  • As a mail proxy server, Nginx is also a very good mail proxy server (one of the earliest purposes of developing this product is also as a mail proxy server), Last.fm describes a successful and wonderful use experience.
  • Nginx installation is very simple, the configuration file is very concise (also supports perl syntax)
  • Server with very few bugs
  • Nginx is very easy to start and can run almost 24/7 without restarting even if it runs for several months.
  • Software version upgrades can be performed without interruption of service.
  • The written codebase is more consistent than other alternatives.
  • It provides a friendly configuration format and has a more modern design than any other web server alternative.
  • is event based and allows you to handle multiple connections without the overhead of context switching.
  • Nginx uses less memory and resources.
  • Nginx has good compatibility with common web applications such as ruby​​​​, Joomla, etc.
  • It is convenient to convert dynamic content to static content.

Advantages of Nginx over Apache

  • Provides only a single entry point – In a containerized environment, containers can be deployed or destroyed when needed, but a single entry point for users to access services is a better approach. The solution provided by Nginx is better, you can use the Nginx server at will, with the use of stable public IP addresses to load balance and route traffic. The Nginx server will get the user’s request and forward it to the corresponding container.
  • Caching – The Nginx server provides caching for static and dynamic content, improving performance, routing each data request to the microservice that generates it. Reduce back-end infrastructure load by implementing micro-caching to cache data for short periods of time, so that applications are isolated to run smoothly during periods of high traffic without the need for secondary scaling of resources.
  • Provides multiple backend applications – Nginx clusters can manage the traffic of various applications more efficiently and are therefore favored by many cloud providers. The Nginx server is used to proxy incoming traffic to various HTTP endpoints that route each request to the appropriate service and also allow rules to be updated without downtime.
  • A/B Testing – Nginx comes with A/B testing capabilities to help roll out microservice applications faster. With Nginx, it is easy to distribute incoming traffic to multiple destinations. Whenever a new microservice is deployed, traffic can be split and a subset of users routed to this application, and traffic can be monitored and KPIs measured to get a feel for how the two versions handle real-time traffic.
  • Consolidated logs – Nginx comes with a standard HTTP log format that allows logging of full web traffic in front of Nginx instead of creating separate logs for each microservice traffic. With Nginx, you can reduce the complexity of creating and maintaining access logs.
  • Scalability and Fault Tolerance – Nginx’s load balancing, health checking features allow scaling of backend infrastructure so that adding or removing any microservices doesn’t affect the user experience. If you want to deploy more microservices, you just need to notify the Nginx server that a new instance has been added to the load balancing pool. If an instance fails, Nginx will not route traffic to that instance until it recovers.
  • Zero Downtime – Nginx keeps your web server running at all times, even seamlessly updating or upgrading system software without any interruptions to your connection, and avoiding any application downtime.
  • Mitigate DoS Attacks – Nginx is known for handling high volumes of incoming requests or HTTP traffic, securing applications during periods of high traffic, generic caching of responses, and smooth delivery of requests, Nginx also acts as a shock absorber for applications and can also control traffic , to protect vulnerable APIs and URLs from request overload. These are implemented to avoid overloading the server by applying concurrency limits and queuing requests.

Disadvantages of Nginx compared to Apache

  • Has less community support than Apache, but now has more cases than Apache.
  • Offers slightly fewer modules and extensions than Apache.
  • Because of the above two points, many applications still use Apache as the first choice.


In most cases, Nginx also has a smaller overall resource footprint than Apache or other popular web servers. It takes up less storage space and consumes less memory. For these reasons, Nginx can help users save money because it can run well on servers with less configuration. (That’s not to say that any web server needs really high-end hardware. However, NGINX tends to do a better job than Apache, and can handle a lot of connections even though it’s running on less expensive hardware, due to its lower resource consumption .)

Leave a Comment