NGINX is a high-performance Web server, mostly used to serve HTTP requests.
Configuration
- NGINX location directive
- NGINX HTTP variables to log
- Byte-range request
- Proxy
- NGINX realip configuration for Cloudflare
Optimization
Access Control
Code Walkthrough
- NGINX code walkthrough - Client closed request
- NGINX code walkthrough - Upstream connect timeout
- NGINX thundering herd problem
Quick Notes
- NGINX reserves a large amount of RAM if
worker_connectionsis set to an unreasonable value. server_tokensis best turned off to reduce metadata leak and save bandwidth.- Nested locations are a trap where
proxy_passdoes not get inherited. Avoid them if possible. - Increase
proxy_buffersandclient_body_buffer_sizeto save a temporary file read and write, but note that it also increases memory pressure.