Nginx
Also known as: engine-x, Nginx Plus, Nginx reverse proxy, OpenResty
Nginx (pronounced 'engine-x') is a web server and reverse proxy.
It can serve static files directly to millions of concurrent users, forward requests to application servers, balance load across multiple backends, and terminate SSL/TLS. It's the web server behind many of the internet's busiest sites.
Nginx, explained at three levels
At home
Nginx is the software that answers when a browser connects to a website. It receives the request ('give me this page'), finds the right file or forwards the request to the app, and sends the response back. It's incredibly fast and handles many users simultaneously.
At work
Nginx is commonly placed in front of web application servers. Instead of the application handling HTTP connections directly, Nginx handles the networking layer (SSL, compression, caching) and passes requests to the application. This separation improves performance and security.
At home
Nginx's main uses: Static file server (serve HTML, CSS, images directly), Reverse proxy (forward requests to app servers like Gunicorn, Node.js, or Rails), Load balancer (distribute requests across multiple app servers using round-robin, least connections, or IP hash), and SSL/TLS termination (handle HTTPS and pass HTTP to the backend).
At work
Nginx configuration is in declarative blocks: `http`, `server` (virtual hosts), and `location` (URL pattern matching). `upstream` blocks define backend server pools for load balancing. Rate limiting and connection limiting are built in. Nginx can serve as a caching reverse proxy, storing upstream responses to reduce backend load.
At home
Nginx uses an event-driven, asynchronous architecture with a fixed number of worker processes (typically one per CPU core) and non-blocking I/O. This allows it to handle tens of thousands of concurrent connections per worker without the thread-per-connection overhead that limited Apache in high-concurrency scenarios.
At work
In Kubernetes, Nginx Ingress Controller is one of the most popular ingress implementations, routing cluster-external traffic to services using Ingress resources. Nginx Unit is a newer application server that runs multiple language runtimes. OpenResty embeds Lua scripting into Nginx (via LuaJIT), enabling complex request manipulation, authentication, and rate limiting at the proxy layer.
Real-world examples
At home
Thomas installed Nginx on his VPS to serve his static website. One configuration file points requests for his domain to the right folder, handles HTTPS via Let's Encrypt certificates, and redirects www to non-www.
At work
Nadia's team runs Nginx as the entry point for all web traffic. It terminates SSL, enforces rate limits (100 requests/second per IP), proxies API requests to a Node.js cluster, and serves static assets directly from disk with aggressive caching headers.
Common confusions
- Nginx and Apache are interchangeable — Both are web servers, but they use different architectures. Nginx handles high concurrency better with its event-driven model. Apache's .htaccess files and per-directory configuration make it easier for shared hosting. Nginx is generally preferred for new deployments.
- Nginx replaces your application server — Nginx is a web server and reverse proxy -- it handles HTTP but doesn't run your application code. Your Python, Node.js, or PHP application still needs its own runtime (Gunicorn, Node, PHP-FPM). Nginx sits in front and proxies requests to the app.
For analysts
Nginx access logs capture every request -- URL, status code, response time, and client IP. These logs are a rich data source for usage analytics; tools like GoAccess or log shipping to Elasticsearch can turn them into insights for business analysts.
History & origin
Nginx was created by Igor Sysoev in 2002 to solve the C10K problem -- how to handle 10,000 concurrent connections on a single server. Released publicly in 2004, it grew to power Rambler (Russia's largest search engine) and quickly expanded globally. Nginx Inc. was founded in 2011 to commercialize Nginx Plus (the enterprise version). F5 Networks acquired Nginx Inc. in 2019. Nginx is now used by over 30% of all websites, making it the most widely used web server alongside Apache.