Connection lost error on fresh n8n install

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n:latest
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - N8N_RUNNERS_ENABLED=true
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - TZ=${GENERIC_TIMEZONE}
      - N8N_EDITOR_BASE_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - N8N_TRUSTED_PROXIES=loopback,linklocal,uniquelocal,172.16.0.0/12
      - DB_SQLITE_POOL_SIZE=1
      - N8N_BLOCK_ENV_ACCESS_IN_NODE=false
    volumes:
      - n8n_data:/home/node/.n8n
      - ./local-files:/files

volumes:
  n8n_data:
<VirtualHost *:80>
  ServerName n8n.<mydomain>.com
  RewriteEngine On
  RewriteRule ^/(.*)$ https://n8n.<mydomain>.com/$1 [R=301,L]
  Alias /favicon.ico /var/www/html/n8n.ico
  <Location "/n8n.ico">
    Require all granted
  </Location>
</VirtualHost>

<VirtualHost *:443>
  ServerName n8n.<mydomain>.com

  SSLEngine on
  SSLCertificateFile    /etc/letsencrypt/live/n8n.<mydomain>.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/n8n.<mydomain>.com/privkey.pem

  ProxyPreserveHost On
  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"


  ProxyTimeout 600
  ProxyPass "/socket.io/"  "ws://127.0.0.1:5678/socket.io/"
  ProxyPassReverse "/socket.io/"  "ws://127.0.0.1:5678/socket.io/"
  Header set Cache-Control "no-transform"

  ProxyPass        / http://127.0.0.1:5678/ retry=0 keepalive=On timeout=600
  ProxyPassReverse / http://127.0.0.1:5678/

  ErrorLog  ${APACHE_LOG_DIR}/n8n_error.log
  CustomLog ${APACHE_LOG_DIR}/n8n_access.log combined
</VirtualHost>

(obviously I only replaced my domain here, it is correct on my server)

Describe the problem/error/question

“Connection lost” appears at the top of my workflows. I am unable to use certain tools such as Discord webhook integration. Attached is my docker compose file and apache config.

What is the error message (if any)?

“Connection lost”

Information on your n8n setup

  • n8n version: 1.111.0
  • Database (default: SQLite): SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu
  • Using cloudflare/apache

Hi @HoggyTheWizard ,

is it a local installation or on a cloud server?
Because this looks like a local machine:
ports: - “127.0.0.1:5678:5678”

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.