VPS - Docker - Serverpilot | Connection lost

Hi,

I really hope someone can help me as I already tried all kind of configs I found in the forum.

My setup:
VPS
Docker
N8N
NGINX (configured by ServerPilot)

My config looks like:
docker_compose.yml:

version: "3.8"

services:
  n8n:
    image: n8nio/n8n:1.94.0
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=automation.mydomain.at
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - N8N_EDITOR_BASE_URL=https://automation.mydomain.at
      - WEBHOOK_TUNNEL_URL=https://automation.mydomain.at
      - N8N_PUSH_BACKEND=websocket    
      - N8N_BASIC_AUTH_ACTIVE=false
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_RUNNERS_ENABLED=true
      - VUE_APP_URL_BASE_API="https://automation.mydomain.at"
    volumes:
      - ./n8n-data:/home/node/.n8n

my nginx-app.conf.erb (overrides the vhosts):

server {
    server_name automation.mydomain.at;

    location / {
        proxy_pass http://127.0.0.1:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_buffering off;
        chunked_transfer_encoding off;
        proxy_cache off;
    }
}

When i open n8n I see this error and can not run my automations:

I already tried several different configs found on the forum but nothing helped so far. Also tried to downgrade → Same. It probably has something to do with nginx but I’m not sure how to dig deeper.

Really appreaciate your feedback.

Thanks and BR from Austria,
Niko

are the logs clear. don’t you see the error info in the logs?

which error logs are the most interesting? I will provide them of course. Sorry, I’m not super familiar with servers.

p.s.: nginx error log ist leer.
docker compose log auch ohne nennenswerte fehler (läuft ja theoretisch auch - also ist ja über den browser aufrufbar)

docker logs -f container id. should show any issues



root@v220241254037301857:/srv/users/dotfox/apps/n8n/public/docker-n8n# docker-compose logs -f n8n
n8n-1  | User settings loaded from: /home/node/.n8n/config
n8n-1  | Initializing n8n process
n8n-1  | n8n ready on ::, port 5678
n8n-1  | n8n Task Broker ready on 127.0.0.1, port 5679
n8n-1  | [license SDK] Skipping renewal on init because renewal is not due yet or cert is not initialized
n8n-1  | Registered runner "JS Task Runner" (tSeYXSbx2MCSo1NKRymoD)
n8n-1  | Version: 1.98.1
n8n-1  |
n8n-1  | Editor is now accessible via:
n8n-1  | https://automation.mydomain.at




That looks pretty much OK, or not?

ya , looks ok. how about access logs and error logs

/srv/users/serverpilot/log/automation.mydomain.at/access.log

tail -f /srv/users/serverpilot/log/automation.mydomain.at/error.log

Thanks a lot for your help so far. here are the anonimized log files.

  1. n8n_nginx.access_ssl.log: [cite_start][ANONYMIZED_IP] - - [16/Jun/2025:14:15:00 +0200] "GET /signin?redire - Pastebin.com
  2. n8n_php8.4.access.log: [ipv6] - [16/Jun/2025:12:57:29 +0200] "GET /index.php" 200 0 - 2962603 2964056 0 - Pastebin.com
  3. n8n_apache.error.log: [Mon Jun 16 13:57:04.480736 2025] [autoindex:error] [pid 2965411:tid 2965413] [c - Pastebin.com
  4. n8n_nginx.access.log: [ipv6] - - [16/Jun/2025:12:57:29 +0200] "GET / HTTP/1.1" 200 463 "-" "Mozilla/5. - Pastebin.com

The most intersting one is probably: the n8n_apache.error.log. Here are some lines (full code above):

[Mon Jun 16 15:50:26.631283 2025] [proxy:error] [pid 2990995:tid 2991019] [client [ipv6]] AH00898: Error reading from remote server returned by /workflow/2kkK2wyF5T4o5ZH9
[Mon Jun 16 16:29:48.039887 2025] [proxy_http:error] [pid 2990995:tid 2991001] (104)Connection reset by peer: [client [ipv6]] AH01102: error reading status line from remote server 127.0.0.1:5678
[Mon Jun 16 16:29:48.039948 2025] [proxy:error] [pid 2990995:tid 2991001] [client [ipv6]] AH00898: Error reading from remote server returned by /rest/push
[Mon Jun 16 16:35:36.597509 2025] [proxy_http:error] [pid 2990995:tid 2991002] (104)Connection reset by peer: [client [ipv6]] AH01102: error reading status line from remote server 127.0.0.1:5678
[Mon Jun 16 16:35:36.597570 2025] [proxy:error] [pid 2990995:tid 2991002] [client [ipv6]] AH00898: Error reading from remote server returned by /workflow/2kkK2wyF5T4o5ZH9
[Mon Jun 16 16:35:37.821642 2025] [proxy_http:error] [pid 2990825:tid 2990885] (104)Connection reset by peer: [client [ipv6]] AH01102: error reading status line from remote server 127.0.0.1:5678
[Mon Jun 16 16:35:37.821680 2025] [proxy:error] [pid 2990825:tid 2990885] [client [ipv6]] AH00898: Error reading from remote server returned by /workflow/2kkK2wyF5T4o5ZH9
[Mon Jun 16 16:45:08.830810 2025] [proxy_http:error] [pid 2990836:tid 2990903] (104)Connection reset by peer: [client [ipv6]] AH01102: error reading status line from remote server 127.0.0.1:5678
[Mon Jun 16 16:45:08.830866 2025] [proxy:error] [pid 2990836:tid 2990903] [client [ipv6]] AH00898: Error reading from remote server returned by /rest/push
[Mon Jun 16 16:55:11.926284 2025] [proxy:error] [pid 2990995:tid 2991016] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:5678 (127.0.0.1:5678) failed
[Mon Jun 16 16:55:11.926362 2025] [proxy_http:error] [pid 2990995:tid 2991016] [client [ipv6]] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Mon Jun 16 16:55:27.851194 2025] [proxy:error] [pid 2990995:tid 2991009] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:5678 (127.0.0.1:5678) failed
[Mon Jun 16 16:55:27.851235 2025] [proxy_http:error] [pid 2990995:tid 2991009] [client [ipv6]] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Mon Jun 16 16:55:43.959180 2025] [proxy:error] [pid 2990995:tid 2991015] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:5678 (127.0.0.1:5678) failed
[Mon Jun 16 16:55:43.959214 2025] [proxy_http:error] [pid 2990995:tid 2991015] [client [ipv6]] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Mon Jun 16 17:18:07.979032 2025] [proxy_http:error] [pid 2990995:tid 2991002] (104)Connection reset by peer: [client [ipv6]] AH01102: error reading status line from remote server 127.0.0.1:5678
[Mon Jun 16 17:18:07.979108 2025] [proxy:error] [pid 2990995:tid 2991002] [client [ipv6]] AH00898: Error reading from remote server returned by /rest/push

Looks like a proxy error but I dont know how to solve it? hmmm…

Check if n8n is actually listening on 127.0.0.1:5678 or 0.0.0.0:5678:

docker inspect <container_id> | grep -i “IPAddress”
or
ss -tulnp | grep 5678

If it’s not on 127.0.0.1, update your NGINX config to reflect the actual internal IP.

Here is the full output because with “grep ip” i didnt get a result:

root@v220241254037301857:~# docker inspect 74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8
[
    {
        "Id": "74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8",
        "Created": "2025-06-16T15:18:05.906955248Z",
        "Path": "tini",
        "Args": [
            "--",
            "/docker-entrypoint.sh"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 3002883,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2025-06-16T15:18:05.958830461Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:f0aef05ceceb6be5202094fd6ad77038d6fc6354736c91c66efe7008d3e590ab",
        "ResolvConfPath": "/var/lib/docker/containers/74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8/hostname",
        "HostsPath": "/var/lib/docker/containers/74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8/hosts",
        "LogPath": "/var/lib/docker/containers/74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8/74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8-json.log",
        "Name": "/docker-n8n-n8n-1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/srv/users/mydomain/apps/n8n/public/docker-n8n/n8n-data:/home/node/.n8n:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "docker-n8n_default",
            "PortBindings": {
                "5678/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": "5678"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "ConsoleSize": [
                0,
                0
            ],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": [],
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/interrupts",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware",
                "/sys/devices/virtual/powercap"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "ID": "74e05818b4a069c8d952a9266bb1ee398a66a4047ad651a5af40588ecdeb30e8",
                "LowerDir": "/var/lib/docker/overlay2/a8824654556496fe2b74da2bb40ced33e52fc24b92fcb7c76e707e87bcb548c6-init/diff:/var/lib/docker/overlay2/573a9a2111cee3c354d3ea836a9a51bf050b89c4fc80560809c60a2543497ddc/diff:/var/lib/docker/overlay2/d8af22ab719979d25cc5d99a328b0010a59be2cbb3f743604c4a8f8592aecd56/diff:/var/lib/docker/overlay2/e1514257baa52ea06c019cc98255fc083d89e347a000e80becc9ce6547ace581/diff:/var/lib/docker/overlay2/a6ddd2c0efc0c825ed227e30e876140ac00a7a2f3909117cacf7054e5998f2d3/diff:/var/lib/docker/overlay2/ce1f45a85de153bbba5642bd577ac41232f02f12de11094746eb7e9cbdf1d753/diff:/var/lib/docker/overlay2/ba788a85575375cad27eb6d737e227a04fe11edd74d9641d32ad5a6efd74a855/diff:/var/lib/docker/overlay2/fc1211987be8b3264ce5610638d51e2b1df1b41cb1a301d5e50f20009f201b5b/diff:/var/lib/docker/overlay2/8f6be4567daae2c13cf1a5bfec30b1db2941b8535f34802e731ba798c61af925/diff:/var/lib/docker/overlay2/f4189478fe0b2cae00fcfaaf32333ed16a324097ca16bda23b56923020e356d9/diff:/var/lib/docker/overlay2/a64a5fd85e14d776d1567512ec618642b5732af2b82fe1d4c4e4a825b9fe47bf/diff:/var/lib/docker/overlay2/92da0abb611afe3daa6fa885834023aa676f16558c97e303272d6eea6c59e85c/diff:/var/lib/docker/overlay2/f041d984f208a04806b0ebeb86602f8f98f3512f28cb1889a27a7d50be5abf62/diff:/var/lib/docker/overlay2/e8f3e6d5c0c256baf80b4914da2a07945b5e74768d2f095eaf1876745b530256/diff:/var/lib/docker/overlay2/cb500e833c68234208c0cf957c8480fd563a183ddfcee7fe333c21b76752a86e/diff",
                "MergedDir": "/var/lib/docker/overlay2/a8824654556496fe2b74da2bb40ced33e52fc24b92fcb7c76e707e87bcb548c6/merged",
                "UpperDir": "/var/lib/docker/overlay2/a8824654556496fe2b74da2bb40ced33e52fc24b92fcb7c76e707e87bcb548c6/diff",
                "WorkDir": "/var/lib/docker/overlay2/a8824654556496fe2b74da2bb40ced33e52fc24b92fcb7c76e707e87bcb548c6/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/srv/users/mydomain/apps/n8n/public/docker-n8n/n8n-data",
                "Destination": "/home/node/.n8n",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "74e05818b4a0",
            "Domainname": "",
            "User": "node",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "5678/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "N8N_PORT=5678",
                "N8N_PUSH_BACKEND=websocket",
                "N8N_EDITOR_BASE_URL=https://automation.mydomain.at/",
                "WEBHOOK_URL=https://automation.mydomain.at/",
                "N8N_PROTOCOL=http",
                "N8N_HOST=0.0.0.0",
                "VUE_APP_URL=https://automation.mydomain.at",
                "N8N_RUNNERS_ENABLED=true",
                "N8N_TRUST_PROXY=true",
                "GENERIC_TIMEZONE=Europe/Berlin",
                "N8N_EXECUTIONS_MODE=regular",
                "WEBHOOK_TUNNEL_URL=https://automation.mydomain.at/",
                "N8N_DIAGNOSTICS_ENABLED=true",
                "N8N_API_URL=https://automation.mydomain.at/",
                "TZ=Europe/Berlin",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_VERSION=22.16.0",
                "YARN_VERSION=1.22.22",
                "NODE_ICU_DATA=/usr/local/lib/node_modules/full-icu",
                "NODE_ENV=production",
                "N8N_RELEASE_TYPE=stable",
                "SHELL=/bin/sh"
            ],
            "Cmd": null,
            "Image": "n8nio/n8n:1.98.1",
            "Volumes": null,
            "WorkingDir": "/home/node",
            "Entrypoint": [
                "tini",
                "--",
                "/docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "1b89fc0a9050300935c60204f10c1b5d808303bb421baf2f2427eafe8af0d621",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.depends_on": "",
                "com.docker.compose.image": "sha256:f0aef05ceceb6be5202094fd6ad77038d6fc6354736c91c66efe7008d3e590ab",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "docker-n8n",
                "com.docker.compose.project.config_files": "/srv/users/mydomain/apps/n8n/public/docker-n8n/docker-compose.yml",
                "com.docker.compose.project.working_dir": "/srv/users/mydomain/apps/n8n/public/docker-n8n",
                "com.docker.compose.service": "n8n",
                "com.docker.compose.version": "2.24.6",
                "org.opencontainers.image.description": "Workflow Automation Tool",
                "org.opencontainers.image.source": "https://github.com/n8n-io/n8n",
                "org.opencontainers.image.title": "n8n",
                "org.opencontainers.image.url": "https://n8n.io",
                "org.opencontainers.image.version": ""
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "bc9dbbda37c258baff33ca07559bce2c11440f9a4d01e7435c7bbaadc5fb7343",
            "SandboxKey": "/var/run/docker/netns/bc9dbbda37c2",
            "Ports": {
                "5678/tcp": [
                    {
                        "HostIp": "127.0.0.1",
                        "HostPort": "5678"
                    }
                ]
            },
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "docker-n8n_default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "docker-n8n-n8n-1",
                        "n8n"
                    ],
                    "MacAddress": "3a:a0:ec:8e:65:84",
                    "DriverOpts": null,
                    "GwPriority": 0,
                    "NetworkID": "fb053754e565fdce3197f76a217d559d16b725def169602553115456c3287206",
                    "EndpointID": "49dc592299b16837234f1bb735efb2d1f7035e72c1446d26444ea207821dc181",
                    "Gateway": "172.18.0.1",
                    "IPAddress": "172.18.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DNSNames": [
                        "docker-n8n-n8n-1",
                        "n8n",
                        "74e05818b4a0"
                    ]
                }
            }
        }
    }
]
root@v220241254037301857:~#

Does it mean, its not listening to 127.0.0.1 or localhost? But why can I access it, if its not listening?

6
root@v220241254037301857:~# ss -tulnp | grep 5678
tcp   LISTEN 0      16384      127.0.0.1:5678       0.0.0.0:*    users:(("docker-proxy",pid=3002951,fd=7))                                                      
root@v220241254037301857:~#

Not sure why my reply with the output was flagged and removed because it was anonymized but however.

I removed the rest of the output:

v220241254037301857:~# 6
tcp liste      127.0.0.1:5678       0.0.0.0:*                                                        

I’m not sure why but my replies get flagged autmatically. But the output says its listening to localhost on port 5678

yrv0x5