I guess the first thing to do here is update your environment options as they are a bit dated.
Can you change your entire environment block to…
environment:
NODEJS_PREFER_IPV4: true
WEBHOOK_URL: https://n8n.ХХХХ.tech
GENERIC_TIMEZONE: ХХХХ
N8N_LOG_LEVEL: debug
N8N_LOG_OUTPUT: file
N8N_LOG_FILE_LOCATION: ./n8n/logs/n8n.log
N8N_LOG_FILE_MAXSIZE: 50
N8N_LOG_FILE_MAXCOUNT: 60
N8N_PROXY_HOPS: 1
This removes the old BASIC_AUTH
option and options that you don’t need.
When it comes to Traefik I can see basicauth
options does this apply to the n8n urls or is it just for the traefik dashboard? I assume it is the dashboard but I am not that familiar with the settings of Traefik.
As another quick test I have just setup n8n with Traefik using the below…
version: "3.7"
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=me@my-internal-domain.com"
- "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- traefik_data:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- "127.0.0.1:5678:5678"
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(`n8n.my-internal-domain.com`)
- 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=my-internal-domain.com
- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n.headers.STSPreload=true
- traefik.http.routers.n8n.middlewares=n8n@docker
environment:
- N8N_HOST=n8n.my-internal-domain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://n8n.my-internal-domain.com/
- GENERIC_TIMEZONE=Europe/London
volumes:
- n8n_data:/home/node/.n8n
volumes:
traefik_data:
external: true
n8n_data:
external: true
When sending this…
In n8n I see this…
Under my webhook for the Telegram trigger I have the correct URL
If I check the /getWebhookInfo
and output it to jq
to make it nicer to read I can see the URL and IP.
I wonder if maybe the issue is with the proxy redirection, It would be interesting to see if you get the same result if you simplify the setup and use our example compose file (or the one above) and see if that works that would then confirm if it is an issue in your traefik config or something else.