Nginx Cheatsheets
Eight comprehensive quick-reference cards. Open one in a tmux pane beside your work session.
Fast Search
# Search all cheatsheets from CLI
grep -r "proxy_pass" /path/to/docs/server/web-server/Nginx/11-cheatsheets/
Cheatsheets in This Module
| Cheatsheet | What It Covers |
|---|---|
| CLI Quick Reference | Service control, config test, signals, logs, site management |
| Config Syntax Reference | nginx.conf, server blocks, location blocks, directives |
| Server Block Setup | Full workflow for adding new sites from CLI |
| PHP-FPM Tuning | Pool config, socket, php.ini, OPcache |
| Security Hardening | TLS, headers, IP access, rate limiting |
| Performance Tuning | HTTP/2, gzip, caching, worker tuning |
| Troubleshooting Matrix | Errors → root cause → exact CLI fix |
| Automation & Bash Scripts | Scripts, cron, opencode AI workflows |
Core Paths — Always Know These
/etc/nginx/
├── nginx.conf # Main config
├── conf.d/*.conf # Site configs (auto-loaded)
├── sites-available/ # All sites
├── sites-enabled/ # Active sites (symlinks)
└── snippets/ # Reusable fragments
/var/log/nginx/
├── access.log # All requests
└── error.log # Errors — check FIRST
/run/nginx.pid # Master PID
/run/php/php8.4-fpm.sock # PHP-FPM socket (Debian)
60-Second Emergency Commands
# Service alive?
sudo systemctl status nginx
# What broke?
sudo tail -30 /var/log/nginx/error.log
# Test config
sudo nginx -t
# Apply changes (no downtime)
sudo nginx -s reload
# Test a site
curl -I http://localhost/
curl -H "Host: example.com" -I http://localhost/
# PHP-FPM OK?
sudo systemctl status php8.4-fpm
ps aux | grep php-fpm | grep -v grep | wc -l
# What's listening?
sudo ss -tlnp | grep nginx