Nginx Articles

All articles

Troubleshooting NGINX: 502 Bad Gateway, 504, 404, 403 and Config Errors

Diagnose common NGINX errors fast: 502 Bad Gateway, 504 Gateway Timeout, 403 Forbidden, 404, 413 and nginx -t failures, using logs and a systematic checklist...

NGINX Architecture: Master Process, Worker Processes and the Event Loop

How NGINX handles thousands of connections: master and worker processes, epoll event loop, non-blocking I/O, worker_connections and zero-downtime reloads.

NGINX Caching and Compression: proxy_cache, Browser Caching and gzip

Speed up sites with NGINX: browser caching headers for static files, proxy_cache for backend responses, microcaching, gzip and Brotli compression.

NGINX Load Balancing: Round Robin, Least Connections, IP Hash and Health Checks

Configure NGINX upstream load balancing with round robin, weights, least_conn, ip_hash and hash. Learn passive health checks, backups and keepalive.

Free HTTPS on NGINX with Let's Encrypt and Certbot (Multiple Domains)

Add free TLS certificates to NGINX with Certbot: HTTP-01 and DNS-01 challenges, multiple domains, wildcard certs, auto-renewal and a hardened TLS config.

NGINX as a Reverse Proxy for Node.js, Python and PHP Applications

Configure NGINX in front of Node.js, Gunicorn/Uvicorn and PHP-FPM. Covers proxy_pass, forwarded headers, WebSockets, timeouts, buffering and upload limits.

NGINX location Matching Explained: Exact, Prefix, Regex and Priority Order

How NGINX chooses a location block: exact =, preferential ^~, regex ~ and ~*, and longest prefix. With worked examples and a step-by-step algorithm.

NGINX Configuration File Structure: Contexts, Directives and Inheritance

Understand nginx.conf: main, events, http, server and location contexts, simple vs block directives, include files and how directive inheritance really works...

How NGINX Hosts Multiple Websites on One Server (Server Blocks Explained)

Host many websites on one NGINX server with server blocks. Learn how the Host header and server_name pick a site, default_server, and sites-available.

What Is NGINX? Web Server, Reverse Proxy and Load Balancer Explained

NGINX explained for beginners: what it does as a web server, reverse proxy, load balancer and cache, why it is so fast, and how a request flows through it.