NGINX Explained: The Server in Front of Your Server
Most web apps do not face the internet alone. In front of them sits a server whose job is to serve files fast, hand requests to the right app, and spread load across machines. NGINX, written by Igor Sysoev and first released in 2004, is that server for a large share of the busiest sites: one process, thousands of connections, and a configuration file that reads like a set of routing rules. Static files, reverse proxies, and load balancing NGINX rests on a few distinctive ideas: An event-driven design: a small number of worker processes handle many connections at once, instead of one thread per visitor, which keeps memory low under heavy traffic. Static files, served directly: images, stylesheets, and scripts come straight from disk, so the app server never wastes time on work the front server can do. Reverse proxying: requests for dynamic pages are passed to an app running on another port or machine, while the visitor only ever sees NGINX. Load balancing built in: list sever...