n8n behind NPM on one Ubuntu VPS stays sane when both containers share the same user-defined network and only NPM publishes 80/443. Map the public hostname to the n8n service name on its internal port — never a host-published port — and leave n8n’s own listener unpublished so a forgotten publish cannot bypass TLS or access lists. Because n8n leans on long-lived WebSocket and webhook callbacks, enable Websockets Support on that Proxy Host and forward Host plus X-Forwarded-Proto so editor URLs and webhook endpoints are minted against the public scheme and name instead of the internal service DNS.
After the Proxy Host is live I hit the editor once over the public hostname, confirm the certificate SAN matches, and watch that a browser WebSocket upgrades instead of falling back to noisy polling or silent disconnects. From inside the NPM container, curl the n8n service by name on the internal port, then the same path through the public vhost; a connect failure is network membership, while a redirect loop or wrong absolute webhook URL usually means the forwarded Host/Proto pair never reached n8n’s public-URL settings.
CDN Edge Ops
n8n behind NPM on one Ubuntu VPS stays sane when both containers share the same user-defined network and only NPM publishes 80/443. Map the public hostname to the n8n service name on its internal port — never a host-published port — and leave n8n’s own listener unpublished so a forgotten publish cannot bypass TLS or access lists. Because n8n leans on long-lived WebSocket and webhook callbacks, enable Websockets Support on that Proxy Host and forward Host plus X-Forwarded-Proto so editor URLs and webhook endpoints are minted against the public scheme and name instead of the internal service DNS.
After the Proxy Host is live I hit the editor once over the public hostname, confirm the certificate SAN matches, and watch that a browser WebSocket upgrades instead of falling back to noisy polling or silent disconnects. From inside the NPM container, curl the n8n service by name on the internal port, then the same path through the public vhost; a connect failure is network membership, while a redirect loop or wrong absolute webhook URL usually means the forwarded Host/Proto pair never reached n8n’s public-URL settings.