Puzzled by install with nginx, only access through direct ip+port

After some missteps, I had to install a new server and a fresh n8n. But I’m stuck and unable to remember my previous setting that worked fine for many years…

n8n is located at n8n.danslombre.fr
certbot is OK for n8n.danslombre.fr

when i try to connect to it, I got Nginx welcome page. Adding
:5678 got an ERR_SSL_PROTOCOL_ERROR

When I connect using the IP, I got the Nginx page. But adding :5678 give me access to n8n (it works fine except for google authentification and such that ends in 404 -but I guess it’ll be fine once I’m able to connect with host name)

Any help will be welcome. Have a good day if you just took the time to read this^^

docker-compose.yml

services:
	n8n:
		image: n8nio/n8n:latest
		restart: unless-stopped
		container_name: n8n
		ports:
			- '5678:5678'
		environment:
			- GENERIC_TIMEZONE=Europe/Paris
			- N8N_BASIC_AUTH_ACTIVE=true
			- N8N_BASIC_AUTH_USER=*****
			- N8N_BASIC_AUTH_PASSWORD=*****
			- N8N_DIAGNOSTICS_ENABLED=false
			- N8N_USER_MANAGEMENT_DISABLED=true
			- WEBHOOK_URL=https://n8n.danslombre.fr
			- N8N_SECURE_COOKIE=false
			- N8N_HOST=n8n.danslombre.fr
			- N8N_PROTOCOL=https
			- N8N_PORT=5678
			- N8N_EDITOR_BASE_URL=https://n8n.danslombre.fr
		volumes:
		  - /home/thierry/n8n/n8n_data:/home/node/.n8n
		

n8n.conf

# Bloc pour rediriger HTTP vers HTTPS
server {
    if ($host = n8n.danslombre.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name n8n.danslombre.fr www.n8n.danslombre.fr;
    listen 80;
    listen [::]:80;

    return 301 https://$server_name$request_uri;
}

# Bloc pour gérer HTTPS avec le reverse proxy
server {
    server_name n8n.danslombre.fr www.n8n.danslombre.fr;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate /etc/letsencrypt/live/n8n.danslombre.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/n8n.danslombre.fr/privkey.pem; # managed by Certbot

    location / {
        proxy_pass http://localhost:5678;
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;
        proxy_ssl_server_name on;

        proxy_set_header Host $host;
        proxy_set_header Connection '';
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        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;

        # Désactiver le buffering pour éviter les problèmes avec n8n
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
    }

}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Thierry

The error would indicate an issue with your SSL connection. Since you’re using Certbot, have you checked that your certificates are valid and properly configured?