Nginx is on the rise to become the new king of web servers.

For a long time Apache has been the king in the web server market. Looking at statistics from recent years, the market share has changed, especially when you look into the top million websites.

Apache is falling like a rock right now as you can see on the graphs below. I predict the fall of Apache will eventually stabilize more soon enough due to Wordpress and Shared-hosting companies still using LAMP stacks. You can also tell that web development overall has changed, especially when you look at scaling, optimizing etc.

Stats from Netcraft below. ( source)


Nginx and modern web development

Igor Sysoev began development of Nginx in 2002. Originally, Nginx was developed to solve the C10k problem, and to fill the needs of websites including Rambler search engine and portal, for which it was serving 500 million requests per day by September 2008. (Wiki)

Even tho Nginx had been around for years, it wasn't until Nginx started as a company in 2011 offering commercial support it become a popular web server alternative, which has resulted in an evolution of the web server market as well pushing the web forward. Many people including me has felt that Apache had become a bit stale and lacking outside of the realm of PHP.

Nginx has become a great foundation for both small and large-scale applications. This blog you're reading now is running on a Nginx web server as it's fast and lightweight. The fact that it has good performance and can handle millions of requests and simultaneous connections is key-features for companies like Netflix. Below shows Nginx own comparison of a classic LAMP stack development compare to how modern web application (such as NodeJS, Python/uWSGI etc.) works.


Gone is the painful .htaccess configuration

One of my personal gripes over the years with Apache has been the server configuration and getting cgi working, mainly the .htaccess-file which is too simple for a modern web application and becomes a it's a trial and error game as everything is read by line and sometimes get overwritten by the next line etc., in comparison to Nginx which features configuration files with nesting, sections, if-statements etc. that's very simple for DevOps/SysOps to pick up and understand and integrates very well with the web application, as well separate parts of it such as serving static files. If something goes wrong as of misconfiguration, I've found the error logs and webpage will tell you at least what's going on so it's easier to find the mistake.

Give it a shot

I would suggest anyone that is currently using Apache who's planning to make a new website or something to give Nginx a shot, compare it and tell your own experience with it. It will be interesting to see in a couple of years if Nginx is the new king.

I've seen more hosting providers that features one-click installers in their dashboards that more and more has used Nginx instead of a LAMP-stack and I think this could be a way to migrate newer Wordpress instances to Nginx when it's all pre-configured and setup by a provider already.