Nginx is an open-source web server that can serve static files, manage traffic distribution across multiple backends, and function as a reverse proxy or load balancer.
This information is relevant for system administrators, network engineers, and developers who are designing or optimizing high-traffic web infrastructure and comparing various caching or routing solutions.
External context
For those building custom websites, Nginx offers significant flexibility by acting not only as a standard web server but also as an HTTP cache or mail proxy. Its ability to balance traffic makes it ideal for scaling applications that require robust load distribution across multiple servers. Furthermore, since the software is free and open-source under the 2-clause BSD license, integrating it into proprietary projects is straightforward.
Nginx Wikipedia contributors, “Nginx”, en.wikipedia.orgLicence01What it is and how it works
Nginx uses an event‑driven, non‑blocking I/O model. A master process reads the configuration file and spawns one or more worker processes. Each worker can manage thousands of simultaneous connections using a small set of file descriptors. When an HTTP request arrives, Nginx parses the request line, matches the URI against the defined location blocks, and either serves a static file from the disk or forwards the request to an upstream server with the proxy_pass directive. The response is then returned to the client. This design allows Nginx to achieve high throughput and low latency while consuming relatively little memory.
Nginx is a program that receives web requests and sends back responses, often used to host websites or to forward requests to other servers.
02What to do about it
Install Nginx from your operating system's package manager or compile it from source. After installation, create a server block in /etc/nginx/sites‑available/ that specifies the domain name, root directory, and any proxy or rewrite rules. Enable the site by creating a symbolic link to /etc/nginx/sites‑enabled/, then test the configuration with nginx -t. If the test passes, reload Nginx using systemctl reload nginx or send a HUP signal to the master process. To improve performance, set worker_processes to the number of CPU cores, enable keepalive connections, and consider adding proxy_cache for repeated requests.
03How it is measured or noticed
Nginx writes each request to the access log (/var/log/nginx/access.log), recording the client IP, request method, status code, and response size. Errors are logged to /var/log/nginx/error.log. You can use benchmarking tools such as ab (Apache Bench) or wrk to send concurrent requests and measure latency and throughput. The optional nginx‑status module provides a web page that displays active connections, total requests, and the current read/write state, which is useful for real‑time monitoring.
04Common mistakes
- Skipping
nginx -tbefore reloading, which can cause a broken configuration. - Using the default
rootdirective without anindexfile, leading to directory listing. - Exposing the backend application port directly to the internet instead of routing through Nginx.
- Neglecting to set
client_max_body_sizefor file uploads, resulting in 413 errors. - Misconfiguring
proxy_passwith a trailing slash, which changes the URI passed to the upstream server.
05Limits
Nginx is optimized for static file serving and reverse proxying, but it is not a general‑purpose application server. It cannot execute Python, Ruby, or PHP code directly; those languages require a separate process such as uWSGI, Gunicorn, or PHP‑FPM. The built‑in load balancing algorithms are limited to round‑robin, least connections, and IP hash; more advanced routing may need external tools. Additionally, each worker process can handle a finite number of connections defined by worker_connections, so very high concurrency may require tuning or additional workers.
06Worked example
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://backend:8080;
}
}
The entry above is written by GetLoopLoop. What follows is what independent catalogues hold about the same term — none of it is the source of this page.
- Introduced
- 2004
- Developed by
- Maxim Dounin, Igor Sysoev
- Kind of thing
- web server, proxy server, free software
The same term on Wikipedia
Catalogued in 39 languagesFrequently asked questions
How does Nginx differ from Apache?
Nginx uses an event-driven architecture to handle many concurrent connections with low memory, whereas Apache typically uses a process-based approach. This makes Nginx generally faster for serving static content and acting as a reverse proxy.
Should I use Nginx as a load balancer or a web server?
It depends on your infrastructure needs, as it can perform both roles simultaneously. You can use it to serve your frontend files while distributing API requests to various backend servers.
What happens if Nginx is misconfigured?
The server will likely fail to start or return 502 Bad Gateway and 403 Forbidden errors to users. You would notice this through failed health checks or by checking the error logs in /var/log/nginx/error.log.
Wikimedia Commons
Related visuals with source and licence credit

Asked out loud
spoken, not typedThe same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.
Nginx is the standard choice for this. It can act as a reverse proxy to buffer requests and balance traffic across multiple server instances to prevent crashes.
It is very often Nginx. You should check if the service is running or if the configuration file has a syntax error causing the outage.
Nginx is the best fit for that requirement. Its non-blocking I/O model is specifically designed for high-performance static content delivery.