Tech Terms Explained Open in the app →

Nginx

Networking · Intermediate · 5 min read

What is it?

Nginx is a high-performance web server that also works as a reverse proxy, load balancer, and cache, sitting in front of applications to serve and route traffic.

Explain like I'm 5

Nginx is like a fast, efficient receptionist for a building: it greets every visitor, hands out files it already has, and directs the rest to the right office.

Why was it created?

Older web servers struggled to handle thousands of simultaneous connections. Nginx was built with an event-driven design to serve huge concurrency efficiently.

Where is it used?

  • Serving static files
  • Reverse proxy in front of apps
  • Load balancing across servers
  • TLS termination and caching

Why should developers care?

Nginx runs in front of a large share of the world's busiest sites, so backend and ops engineers configure it regularly.

How does it work?

Nginx uses an event-driven model to handle many connections with few resources. It serves static content directly and forwards other requests to backend apps, optionally balancing load and caching responses.

Real-world example

A site puts Nginx in front of its app servers; Nginx serves images directly, terminates HTTPS, and forwards dynamic requests to the backend.

Common use cases

  • Static file serving
  • Reverse proxying to app servers
  • Load balancing
  • TLS termination and caching

Advantages

  • Handles high concurrency efficiently
  • Low memory footprint
  • Versatile (server, proxy, balancer, cache)
  • Battle-tested and widely deployed

Disadvantages

  • Configuration syntax has a learning curve
  • Dynamic config changes need a reload
  • Advanced features can get complex

When should you use it?

As a front door for web apps to serve static content, terminate TLS, and route or balance traffic.

When should you avoid it?

When a managed cloud load balancer or platform already covers these needs.

Alternatives

Apache HTTP ServerHAProxyCaddyCloud load balancers

Related terms

Reverse ProxyLoad BalancerHTTPCaching

Interview questions

Beginner

  • What is Nginx used for?
  • What is a web server?

Intermediate

  • What is a reverse proxy?
  • What does TLS termination mean?

Senior

  • How does Nginx's event-driven model handle high concurrency?
  • How would you configure it as a load balancer?

Common misconceptions

  • "Nginx is only a web server" — it's also a reverse proxy, load balancer, and cache.
  • "Nginx runs your application code" — it serves and routes traffic; your app runs behind it.

Fun facts

  • Its name is pronounced 'engine-x'.
  • It was created specifically to solve the challenge of serving many simultaneous connections.

Timeline

  • 2004 — First public release

Learning resources

Quick summary

Nginx is a fast, event-driven web server and reverse proxy that serves static content and routes or balances traffic to backend apps.

Cheat sheet

  • Web server + reverse proxy + balancer + cache
  • Event-driven, high concurrency
  • Common front door for apps
  • Handles TLS and static files

If you remember only one thing

Nginx is the efficient front door that serves static content and routes traffic to your app.