Skip to main content

NGINX

Introduction-:

Welcome to NGINX Wiki! NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

NGINX is one of a handful of servers written to address the C10K problem. Unlike traditional servers, NGINX doesn’t rely on threads to handle requests. Instead it uses a much more scalable event-driven (asynchronous) architecture. This architecture uses small, but more importantly, predictable amounts of memory under load. Even if you don’t expect to handle thousands of simultaneous requests, you can still benefit from NGINX’s high-performance and small memory footprint. NGINX scales in all directions: from the smallest VPS all the way up to large clusters of servers.

NGINX powers several high-visibility sites, such as Netflix, Hulu, Pinterest, CloudFlare, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite, Zappos, Media Temple, Heroku, RightScale, Engine Yard, StackPath, CDN77 and many others.

How does Nginx work?

Nginx is built to offer low memory usage and high concurrency. Rather than creating new processes for each web request, Nginx uses an asynchronous, event-driven approach where requests are handled in a single thread.

With Nginx, one master process can control multiple worker processes. The master maintains the worker processes, while the workers do the actual processing. Because Nginx is asynchronous, each request can be executed by the worker concurrently without blocking other requests.

Some common features seen in Nginx include:

  • Reverse proxy with caching
  • IPv6
  • Load balancing
  • FastCGI support with caching
  • WebSockets
  • Handling of static files, index files, and auto-indexing
  • TLS/SSL with SNI'

Nginx vs Apache Usage Stats

Apache is another popular open-source web server. In terms of raw numbers, Apache is the most popular web server in existence and is used by 43.6% (down from 47% in 2018) of all websites with a known web server, according to W3Techs. Nginx comes in a close second at 41.8%.

Netcraft ran a survey across 233 million domains and found Apache usage at 31.54% and Nginx usage at 26.20%.

mkt-share

While Apache is the most popular overall option, Nginx is actually the most popular web server among high-traffic websites.

When you break down usage rates by traffic, Nginx powers:

  • 60.9% of the 100,000 most popular sites (up from 56.1% in 2018)
  • 67.1% of the 10,000 most popular sites (up from 63.2% in 2018)
  • 62.1% of the 1,000 most popular sites (up from 57% in 2018)

In fact, Nginx is used by some of the most resource-intensive sites in existence, including Netflix, NASA, and even WordPress.com.

Apache's usage, on the other hand, moves in the opposite direction as a site's traffic increases. It powers:

  • 24.0% of the 100,000 most popular sites (down from 27.1% in 2018)
  • 18.8% of the 10,000 most popular sites (down from 21.5% in 2018)
  • 16.6% of the 1,000 most popular sites (up from 16.2% in 2018)

If we take a look at Google Search terms since 2004 we can see that Apache has been on a steady decline, while NGINX has seen slight growth.

mkt-share

Again, when you consider that NGINX performs better under scale, it's not surprising that high-traffic websites opt for NGINX over Apache. Check out our more in-depth comparison of Nginx vs Apache.

How to Check If You're Running Nginx or Apache

On most websites, you can simply check the server HTTP header to see if it says Nginx or Apache. You can see HTTP headers by launching the network tab in Chrome Devtools. Or you can check headers in a tool like Pingdom or GTmetrix.

However, the HTTP header might not always reveal the underlying web server. For example, if your WordPress site is behind a proxy service such as Cloudflare, the server HTTP header will then say cloudflare instead.

mkt-share

Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 28 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the plan that's right for you.

Nginx vs Nginx Plus

There are two versions of Nginx: OSS Nginx and Nginx Plus. Nginx Plus offers additional features not included in OSS Nginx, such as active health checks, session persistence based on cookies, DNS-service-discovery integration, Cache Purging API, AppDynamic, Datalog, Dynatrace New Relic plug-ins, Active-Active HA with config sync, Key-Value Store, on-the-fly with zero downtime updates upstream configurations, and key‑value stores using Nginx Plus API and web application firewall (WAF) dynamic module.

So that is all that you need to get started with the nginx, if you have any doubts you can definetly visit the official documentation of nginx.

HAPPY LEARNING 😎🙌

References-:

  • For preparing these documents official documentation of nginx. was referred for maintaining the authenticity of the code and also for making the topics more informative some external sources like blogs were referred.