Nginx Cheatsheet
NewServer blocks, location matching, reverse proxy, SSL config, rewrites, and common directives.
Frequently Asked Questions
Does this help with Nginx location matching order?
Yes. It includes exact matches, regular prefix locations, ^~ prefix priority, regex locations, and try_files, which are the parts people usually mix up.
Is WebSocket proxying covered or only basic proxy_pass?
It covers both. There is a plain proxy_pass example plus the HTTP/1.1 and Upgrade/Connection headers needed for WebSocket proxying.
Can I find SSL and security-header examples in the same place?
Yes. The SSL & Security category includes listen 443 ssl http2, certificate paths, TLS protocol settings, HSTS, common security headers, and basic auth.
What changes when I switch to full syntax?
Short mode shows terse reminders like proxy_pass http://backend;. Full mode expands to fuller config blocks, and the Copy syntax button copies that fuller stored snippet.
Does it include performance-related directives too?
Yes. You get examples for gzip, browser caching with expires, client_max_body_size, limit_req_zone and limit_req, plus sendfile and worker_processes.