Can’t get n8n deployed behind nginx proxy manager. n8n is deployed in a stack in Portainer.
- n8n version:
- Database (default: postgres):
- Running n8n via Docker
- Operating system: - ubuntu
services:
postgres:
image: postgres:16
container_name: n8n_postgres
restart: always
environment:
POSTGRES_DB: ${DB_POSTGRESDB_DATABASE}
POSTGRES_USER: ${DB_POSTGRESDB_USER}
POSTGRES_PASSWORD: ${DB_POSTGRESDB_PASSWORD}
volumes:
- n8n_pg_data:/var/lib/postgresql/data
networks:
- n8n-network
n8n:
image: n8nio/n8n
container_name: n8n
restart: always
ports:
- 5678:5678
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${DB_POSTGRESDB_DATABASE}
- DB_POSTGRESDB_USER=${DB_POSTGRESDB_USER}
- DB_POSTGRESDB_PASSWORD=${DB_POSTGRESDB_PASSWORD}
- DB_POSTGRESDB_SCHEMA=${DB_POSTGRESDB_SCHEMA}
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
- N8N_HOST=${N8N_HOST}
- WEBHOOK_URL=${WEBHOOK_URL}
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- TZ=${TZ}
- N8N_PUSH_BACKEND=${N8N_PUSH_BACKEND}
- N8N_RUNNERS_ENABLED=${N8N_RUNNERS_ENABLED}
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- N8N_SECURE_COOKIE=${N8N_SECURE_COOKIE}
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
networks:
- n8n-network
volumes:
n8n_data:
n8n_pg_data:
networks:
n8n-network:
external: true
.env -
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n_user
DB_POSTGRESDB_PASSWORD=n8npass123
DB_POSTGRESDB_SCHEMA=public
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=strongadminpass
N8N_ENCRYPTION_KEY=superSecureRandomKey_ChangeThis123!
N8N_HOST=n8n.domain.live
WEBHOOK_URL=https://n8n.domain.live/
GENERIC_TIMEZONE=Asia/Kolkata
TZ=Asia/Kolkata
N8N_RUNNERS_ENABLED=true
N8N_PUSH_BACKEND=websocket
N8N_SECURE_COOKIE=false/true tried both
For SSL, I am using Cloudflare origin certificates as custom SSL in Nginx Proxy Manager.
When I try to access the n8n on the local network, I can access the dashboard.
I get 504 Gateway time-out when I access https://n8n.domain.live
No errors in n8n logs in Portainer.
