Nginx
Cheat sheet · https://pcornel.dk/topic.php?topic=2876
Answer
Nginx is an event-driven web server and reverse proxy, configured with server blocks (virtual hosts) and location blocks, commonly in /etc/nginx/nginx.conf, conf.d/ and sites-enabled/.
Remember
nginx -t before every reload. nginx -T prints the full merged config. The first matching server block for a port is the default — unknown names land there. 502 means the upstream refused or crashed; 504 means it timed out.
First checks
systemctl status nginx|apache2|httpd— web server statenginx -t / apachectl configtest— configuration testss -ltnp | grep -E ':80|:443'— listening portscurl -vI https://<name>— response, headers and TLStail -f /var/log/nginx/error.log— error log (or apache2/httpd)
Commands
systemctl reload
Verify in this order
request → listen socket → server_name match → location → static file or proxy_pass → response
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2876