Hello n8n community,
I’m encountering an SSL issue while trying to access my n8n instance through a Traefik reverse proxy. When I attempt to load https://n8n.jmcruz.me in my browser, I receive the following error:"This site can’t provide a secure connection
n8n.jmcruz.me sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
My setup:
- n8n and Traefik running in Docker containers
- PostgreSQL as the database (in a separate container)
- Ubuntu VPS
- Domain: n8n.jmcruz.me
I’ve configured Traefik to use Let’s Encrypt for SSL certificates. Here’s my docker-compose.yml file:
version: '3'
services:
traefik:
image: "traefik"
restart: always
command:
- "--api=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
- "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
- "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.$
# ... other options ...
- "--serversTransport.forwardingTimeouts.dialTimeout=30s"
- "--serversTransport.forwardingTimeouts.responseHeaderTimeout=30s"
- "--log.level=DEBUG"
- "--accesslog=true"
ports:
- "80:80"
- "443:443"
volumes:
- /n8n/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
n8n:
image: n8nio/n8n
container_name: n8n
restart: always
ports:
- "5678:5678"
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=n8n-postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=n8npassword
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- N8N_LOG_LEVEL=debug
volumes:
- ~/n8n-data:/home/node/.n8n
networks:
- n8n-network
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=web,websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
- traefik.http.middlewares.n8n.headers.SSLRedirect=true
- traefik.http.middlewares.n8n.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n.headers.forceSTSHeader=true
- traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n.headers.STSPreload=true
- traefik.http.routers.n8n.middlewares=n8n@docker
networks:
n8n-network:
external: true
volumes:
traefik_data:
I’ve tried the following troubleshooting steps:
- Set Traefik log level to DEBUG
- Set n8n log level to debug
- Ensured ports 80 and 443 are open
- Checked DNS configuration for n8n.jmcruz.me
- Restarted containers multiple times
Despite these efforts, I’m still unable to access the n8n editor due to the SSL error. Traefik logs don’t show any obvious errors related to certificate acquisition.Can anyone help identify what might be causing this SSL issue or suggest additional troubleshooting steps? Any assistance would be greatly appreciated.
Thank you in advance for your help!
Note:
I have a working n8n server before, been using it for a month without problem before I decided to switch to PostgreSQL and that’s when all this problem occurred. I followed the instruction here: n8n - Docker Compose Installation
I’m still trying to figure things out regarding running a server, so I apologize if this comes across as a beginner’s question. I’ve been attempting to solve this problem for the past two days with the help of this forum and AI, but I’m starting to feel overwhelmed and ready to give up.