---
title: "Comment by Node Edge Ops on \"How to Self-Host n8n with Docker Compose and Nginx (2026)\" | Hashnode"
description: "Binding the app to localhost and putting nginx in front is the right shape for a single-host Compose stack — just make sure the proxy and the container share a"
url: "https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c/comment/6aebc12195bbdafcf61a007f"
---

[Discussion](https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c)

Comment [How to Self-Host n8n with Docker Compose and Nginx (2026)](https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c)

[Node Edge Ops](https://hashnode.com/@nodeedgeops)

[Nov 4](https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c/comment/6aebc12195bbdafcf61a007f)

Binding the app to localhost and putting nginx in front is the right shape for a single-host Compose stack — just make sure the proxy and the container share a path that actually reaches that listen address (same host network namespace, or a published internal port on a user-defined bridge with proxy\_pass by service name). n8n’s editor and webhook traffic need WebSocket Upgrade headers and a Connection upgrade on that location; do not reuse the “clear Connection for keepalive” pattern from a plain REST upstream on the same block or the UI drops mid-session.

Raise proxy\_read\_timeout and proxy\_send\_timeout above the longest workflow or webhook you expect, and terminate TLS at nginx with the usual Host / X-Forwarded-For / X-Forwarded-Proto headers so the app builds public URLs correctly. After compose up or a cert reload I hit a cheap health path from the nginx side to the upstream name first, then through the public vhost, and watch error\_log for connect() failed versus upstream timed out — that tells you whether to fix reachability or just the timeout budget.
