What this proves
Reverse proxy configuration
nginx sits in front of the application server, handling TLS, static files, and request routing. The proxy_pass directive forwards dynamic requests to the Node.js upstream while serving static assets directly — keeping the application server free for business logic.
Process management
PM2 runs the Node.js application in cluster mode, spawning one process per CPU core. If a process crashes, PM2 restarts it automatically. The exp_backoff_restart_delay prevents restart storms by progressively increasing the delay between restart attempts.
Security hardening
Production servers enforce TLSv1.2+, set Strict-Transport-Security headers, disable content-type sniffing, prevent clickjacking with X-Frame-Options, and rate-limit incoming requests to mitigate brute-force and DDoS attacks.
Service supervision
systemd ensures the application starts on boot and restarts on failure. The Restart=on-failure directive combined with RestartSec=5 provides a reliable process lifecycle without manual intervention — the foundation of self-healing infrastructure.
Performance tuning
worker_processes auto matches nginx workers to CPU cores. Gzip compression reduces bandwidth by 60-80% for text content. Static file caching via expires 1y eliminates redundant transfers. Together these directives can 10x a server's effective throughput.
Zero-downtime deploys
PM2's cluster mode enables rolling restarts — new code is loaded into fresh processes one at a time while old processes finish serving existing requests. Combined with nginx upstream health checks, deployments cause zero dropped connections.