Deployment Presets
Node.js & Next.js SSR Reverse Proxy vhost in CloudPanel
Configure CloudPanel Node.js site templates with PM2 cluster workers, HTTP/1.1 keepalive proxy_pass, WebSocket upgrades, and static asset bypass.
PM2 Cluster · Static _next/ Immutable · Zero PHP Overhead
Bypassing Node for Hashed Next.js Assets
Routing /_next/static/ directly through Nginx expires max saves 30-45% of Node.js event-loop work on every page load while giving browsers immutable cache headers.
Disabling Unused PHP-FPM Pools
When creating a pure Node.js site in CloudPanel, select the Node.js site type rather than PHP so zero PHP-FPM master structs or Unix sockets are provisioned.
Measured Parameters & CloudPanel Stack Directives
| Parameter / Setting | Recommended Value | Operational Reason |
|---|---|---|
| Upstream Proxy | proxy_http_version 1.1 + keepalive | Reuses local TCP sockets between Nginx and Node 22 SSR workers |
| Static Asset Route | location /_next/static/ alias | Serves hashed JS/CSS directly from Nginx without hitting Node |
| Process Manager | PM2 cluster + max_memory_restart | Auto-recycles SSR workers cleanly before V8 heap fragmentation |
| Security Headers | TLS 1.3 + HSTS + X-Frame-Options | Terminated once at Nginx edge inside CloudPanel vhost.conf |