Nginx guides
Hands-on guides that cover Nginx. Every command is run and verified on a live server before it is published.
GuideAn App Behind nginx
Never put your app on the public internet directly. Bind it to localhost and run nginx as a reverse proxy in front, so only nginx faces the world.
GuideInstall Nginx and Its Config Model
Start from a bare slice: install nginx, watch it serve the default page, then learn the nginx config model, the tree of contexts every server block lives in.
GuideSecuring Your Web Server
A hardened server with an unconfigured web server is still open. The nginx security headers, rate limiting, and TLS that close the second door.
GuideHTTPS and Certificates
Plain HTTP exposes passwords and sessions. Put a certbot certificate from letsencrypt.org in front of nginx, force HTTPS, and use only modern TLS.
GuidePut gunicorn Behind nginx
Put gunicorn behind nginx over a unix socket, forward the right proxy headers, and prove a request through nginx returns 200 from the Flask app.
GuideDeploys Without Downtime
Restarting your app to ship code drops in-flight requests. Run two app instances behind nginx and restart them one at a time for a zero downtime deploy.
GuideHTTP/2, HTTP/3 and Compression
HTTP/2 and compression are the highest speed-per-effort win on a web server. Enable both on a live server, with the nginx 1.24 version trap that trips people up.
GuideCaching, Static and Proxy
Nginx caches in two places: the browser and the proxy. Turn on both, prove each with the cache headers, and learn the one rule that keeps proxy caching safe.
GuideHardening, Headers and Logging
Nginx hardening, made concrete: hide the version, add the security headers browsers enforce, log what an incident needs, and turn those logs into blocking.