Webhook url differnt from n8n domain

Hello everyone,

I’ve just updated to 1.0+ today, and I can’t find the way to have the webhook url different from the N8N host. I want to use two different subdomain. I’m running it on my private server with docker.

Before, I had n8n.domain to connect to n8n and api.domain to use the webhook, but I can’t do it now because webhook_tunnel_url in environement variables is not available anymore.

I tried to put WEBHOOK_URL=https://api.${DOMAIN_NAME} in the environements variables, but i’m still not able to send webhook, got 404 errors. And with this configuration, webhook to n8n.domain still works. I’ve correctly register the two DNS A pointing to my server ip, and I’ve tried with proxied on/off.

Does someone have an idea, how I could manage to make it work ?

Thank you for your help

Hey @romaindef,

The webhook_url is the correct option to use, It sounds like there could still be a routing issue going on although if it was working previously with the old option the new option is the same so it should carry on working.

When you get the 404 errors does your reverse proxy log anything?

Thank you for your answer @Jon !

I’m affraid I’ve not able to see my logs on cloudfare because of my version. However, got nothing on server side.
Am I right that if I made two A DNS for n8n and api within my server ip, it should works. And should I let the DNS proxied or not ?

Does someone else made this kind of set-up and made it work, and can help me a bit ? :smiley:

Hey @romaindef,

n8n itself doesn’t actually care which domain you access it from as long as the DNS records point to the IP it will be fine.

Do you have a reverse proxy in place like Caddy / Traefik and did you change the domain or just the environment option?

yes @Jon, you’re right I think comes from traefik (maybe ssl ?)

Here’s what’s inside my docker-compose.yaml for traefik :

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.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:

Should I edit traefik data ?