Deep Dive on NGINX Directives
NGINX directives—from the basic to the advanced—with practical examples, recommended default values, and production tips.
1. Global and Core Directives
worker_processes
worker_processes auto;
error_log
error_log /var/log/nginx/error.log warn;
include
2. Events Block Directives
worker_connections
multi_accept
3. HTTP Block Directives
include (HTTP Context)
sendfile, tcp_nodelay, tcp_nopush
keepalive_timeout
client_max_body_size
4. Server and Location Block Directives
listen and server_name
root and index
error_page
5. URI Processing Directives
location
rewrite
try_files
6. Proxying and Upstream Directives
proxy_pass
upstream
proxy_set_header
proxy_redirect
7. FastCGI, SCGI, and uWSGI Directives
fastcgi_pass and fastcgi_param
8. Caching and Compression Directives
proxy_cache_path and proxy_cache
gzip
9. Security and Advanced Directives
SSL/TLS Directives
allow and deny
auth_basic
resolver
client_body_timeout and client_header_timeout
Last updated