Skip to content

Nginx

In one line

Nginx is a popular open-source web server, reverse proxy, and load balancer known for high performance and low resource usage.

In simple words

Nginx (pronounced "engine-x") is one of the most popular web servers in the world. It can serve as a web server, reverse proxy, load balancer, and HTTP cache.

Nginx is known for being fast and efficient. It uses an event-driven, asynchronous architecture that lets it handle thousands of concurrent connections with very little memory. This makes it ideal for high-traffic sites.

In a DevOps context, Nginx is often used as an Ingress Controller in Kubernetes — it receives external HTTP traffic and routes it to the right Service based on Ingress rules. It is also commonly used as a reverse proxy in front of application servers.

Example

nginx
server {
    listen 80;
    server_name api.example.com;

    location / {
        proxy_pass http://backend:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

This Nginx config listens on port 80 and proxies all requests to a backend server on port 3000.

How it works

  1. Nginx listens on configured ports (e.g., 80, 443).
  2. When a request arrives, it matches a server block by host and path.
  3. It serves static files directly or proxies to a backend server.
  4. It can also handle TLS, caching, and load balancing.

Common confusions

  • Confused with: Apache

    The difference: Nginx uses an event-driven architecture (handles many connections per thread); Apache traditionally uses a process/thread per connection, using more memory under load.

Related terms

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary