Searchable Nginx cheat sheet with 80+ directives, CLI flags, and
full templates ops engineers actually paste into production.
Thirteen categories: CLI commands (nginx -t / -s reload / -s quit
/ -s reopen / -V / -T), core directives (worker_processes, events,
http, include, sendfile, keepalive_timeout, client_max_body_size,
worker_rlimit_nofile), server block (listen 80 / 443 ssl http2,
server_name wildcard + regex, root, index, return 444 for unknown
Host), location matching with the full priority order (= exact,
^~ preferential prefix, ~ / ~* regex, plain prefix), reverse
proxy (proxy_pass trailing-slash gotcha, upstream pools,
proxy_set_header Host / X-Real-IP / X-Forwarded-For /
X-Forwarded-Proto, WebSocket Upgrade + Connection upgrade,
proxy_http_version 1.1, proxy_read_timeout, proxy_buffering off
for SSE), static files (root vs alias trap, try_files for SPA
fallback, autoindex, expires + immutable), redirects (return
301 / 302 / 410, rewrite last vs break, "if is evil"), HTTPS / SSL
(ssl_certificate fullchain, TLSv1.2/1.3, Let's Encrypt +
certbot --nginx, HSTS preload, OCSP stapling, session cache),
caching (gzip + gzip_types, ngx_brotli, proxy_cache_path
stale-while-revalidate, Cache-Control), rate limit (limit_req_zone
with $binary_remote_addr, limit_conn_zone, limit_req_status 429),
logging (access_log buffer + flush, error_log levels, JSON
log_format), the seven errors that ruin your day (502 / 504 /
SSL handshake / permission denied / port in use / conflicting
server_name / worker connections), and six copy-ready full
templates (static site, reverse proxy to Node, HTTPS with
Let's Encrypt, load balancer with fail_timeout, PHP-FPM,
/healthz). Every entry has the directive, bilingual EN/ZH
description, the trap people hit, and one to four copy-ready
examples. Search across directive + description + pitfall +
example, category chips, one-click copy. Fully client-side, no
config upload. Pair with Docker, kubectl, Git Cheatsheets.