Webhook URLs showing up incorrectly with extra /webhook

Describe the problem/error/question

Hi!

I’ve set up n8n on a Hetzner VPS using a community installer script. During the installation it asked me for the webhook URL, and I just went with the default: n8n.domain.com/webhook.

Everything works fine in general, but I noticed that the webhook and form URLs inside the nodes are being generated incorrectly. For example:

  • Webhook node shows something like:
    https://n8n.domain.com/webhook/webhook/...

  • Form node shows:
    https://n8n.domain.com/webhook/form/...

The thing is, the working URLs don’t actually have the extra /webhook. If I manually remove /webhook from the link, it works.

That’s already a bit annoying, but the bigger issue is with the Form Ending node: when the form is submitted, instead of showing the final message, the submit button just keeps spinning in a loop. My guess is that the backend is trying to hit the wrong URL (with /webhook in it) and that’s why it breaks.

I assume this might just be a single config issue (maybe something in Portainer or the docker-compose.yml), but I don’t want to blindly mess around and break other stuff.

:backhand_index_pointing_right: Has anyone run into this before? Any reliable way to fix it without reinstalling everything from scratch?

Thanks a lot!

Please share your workflow

Information on your n8n setup

  • n8n version: last
  • Database (default: SQLite): postgree
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): VPS/Docker
  • Operating system: Debian Linux

Hey @leocamargo hope all is good. Welcome to the community.

Would you like to share a screenshot of the webhook with an extra /webhook, as well as your docker-compose.yml content?

Without looking at the config, the most probable cause would be if you have WEBHOOK_URL configured with /webhook at the end.

Hey, thanks for the quick reply!

Yeah, I actually found the WEBHOOK_URL variable in Portainer and I was already suspicious about it, but I wasn’t 100% sure if I could safely change it without messing up other configs.

As you suggested, here are the screenshots showing the webhook URL issue, plus the content of my docker-compose.yml below.

Webhooks:

Forms:

docker-compose.yml:

version: "3.7"
services:

## --------------------------- ORION --------------------------- ##

  n8n_editor:
    image: n8nio/n8n:latest
    command: start

    networks:
      - rede

    environment:
      - N8N_FIX_MIGRATIONS=true 
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n_queue
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=postgres
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}

      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}

      - N8N_HOST=n8n.mydomain.com
      - N8N_EDITOR_BASE_URL=https://n8n.mydomain.com/
      - WEBHOOK_URL=https://n8n.mydomain.com/webhook/
      - N8N_PROTOCOL=https
      - N8N_ONBOARDING_FLOW_DISABLED=true

      - NODE_ENV=production
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_TIMEOUT=3600
      - EXECUTIONS_TIMEOUT_MAX=7200
      - OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
      - N8N_RUNNERS_ENABLED=true
      - N8N_RUNNERS_MODE=internal
      - N8N_RUNNERS_MAX_CONCURRENCY=5

      - N8N_REINSTALL_MISSING_PACKAGES=true
      - N8N_COMMUNITY_PACKAGES_ENABLED=true
      - N8N_NODE_PATH=/home/node/.n8n/nodes
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true

      - N8N_SMTP_SENDER=${SMTP_EMAIL}
      - N8N_SMTP_USER=${SMTP_EMAIL}
      - N8N_SMTP_PASS=${SMTP_PASS}
      - N8N_SMTP_HOST=smtp.gmail.com
      - N8N_SMTP_PORT=465
      - N8N_SMTP_SSL=false

      - QUEUE_BULL_REDIS_HOST=n8n_redis
      - QUEUE_BULL_REDIS_PORT=6379
      - QUEUE_BULL_REDIS_DB=1

      - N8N_METRICS=true

      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=336

      - N8N_AI_ENABLED=false
      - N8N_AI_PROVIDER=openai
      - N8N_AI_OPENAI_API_KEY=${OPENAI_KEY}

      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash

      - GENERIC_TIMEZONE=America/Sao_Paulo
      - TZ=America/Sao_Paulo
      - N8N_DEFAULT_LOCALE=pt-BR

    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          cpus: "1"
          memory: 1024M
      labels:
        - traefik.enable=true
        - traefik.http.routers.n8n_editor.rule=Host(`n8n.mydomain.com`)
        - traefik.http.routers.n8n_editor.entrypoints=websecure
        - traefik.http.routers.n8n_editor.priority=1
        - traefik.http.routers.n8n_editor.tls.certresolver=letsencryptresolver
        - traefik.http.routers.n8n_editor.service=n8n_editor
        - traefik.http.services.n8n_editor.loadbalancer.server.port=5678
        - traefik.http.services.n8n_editor.loadbalancer.passHostHeader=1

## --------------------------- ORION --------------------------- ##

  n8n_webhook:
    image: n8nio/n8n:latest
    command: webhook

    networks:
      - rede

    environment:
      - N8N_FIX_MIGRATIONS=true 
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n_queue
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=postgres
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}

      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}

      - N8N_HOST=n8n.mydomain.com
      - N8N_EDITOR_BASE_URL=https://n8n.mydomain.com/
      - WEBHOOK_URL=https://n8n.mydomain.com/webhook/
      - N8N_PROTOCOL=https
      - N8N_ONBOARDING_FLOW_DISABLED=true

      - NODE_ENV=production
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_TIMEOUT=3600
      - EXECUTIONS_TIMEOUT_MAX=7200
      - OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
      - N8N_RUNNERS_ENABLED=true
      - N8N_RUNNERS_MODE=internal

      - N8N_REINSTALL_MISSING_PACKAGES=true
      - N8N_COMMUNITY_PACKAGES_ENABLED=true
      - N8N_NODE_PATH=/home/node/.n8n/nodes
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true

      - N8N_SMTP_SENDER=${SMTP_EMAIL}
      - N8N_SMTP_USER=${SMTP_EMAIL}
      - N8N_SMTP_PASS=${SMTP_PASS}
      - N8N_SMTP_HOST=smtp.gmail.com
      - N8N_SMTP_PORT=465
      - N8N_SMTP_SSL=false

      - QUEUE_BULL_REDIS_HOST=n8n_redis
      - QUEUE_BULL_REDIS_PORT=6379
      - QUEUE_BULL_REDIS_DB=1

      - N8N_METRICS=true

      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=336

      - N8N_AI_ENABLED=false
      - N8N_AI_PROVIDER=openai
      - N8N_AI_OPENAI_API_KEY=${OPENAI_KEY}

      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash

      - GENERIC_TIMEZONE=America/Sao_Paulo
      - TZ=America/Sao_Paulo
      - N8N_DEFAULT_LOCALE=pt-BR
      
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          cpus: "1"
          memory: 1024M
      labels:
        - traefik.enable=true
        - traefik.http.routers.n8n_webhook.rule=(Host(`n8n.mydomain.com/webhook`))
        - traefik.http.routers.n8n_webhook.entrypoints=websecure
        - traefik.http.routers.n8n_webhook.priority=1
        - traefik.http.routers.n8n_webhook.tls.certresolver=letsencryptresolver
        - traefik.http.routers.n8n_webhook.service=n8n_webhook
        - traefik.http.services.n8n_webhook.loadbalancer.server.port=5678
        - traefik.http.services.n8n_webhook.loadbalancer.passHostHeader=1

## --------------------------- ORION --------------------------- ##

  n8n_worker:
    image: n8nio/n8n:latest
    command: worker --concurrency=10

    networks:
      - rede

    environment:
      - N8N_FIX_MIGRATIONS=true 
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n_queue
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=postgres
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}

      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}

      - N8N_HOST=n8n.mydomain.com
      - N8N_EDITOR_BASE_URL=https://n8n.mydomain.com/
      - WEBHOOK_URL=https://n8n.mydomain.com/webhook/
      - N8N_PROTOCOL=https
      - N8N_ONBOARDING_FLOW_DISABLED=true

      - NODE_ENV=production
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_TIMEOUT=3600
      - EXECUTIONS_TIMEOUT_MAX=7200
      - OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
      - N8N_RUNNERS_ENABLED=true
      - N8N_RUNNERS_MODE=internal

      - N8N_REINSTALL_MISSING_PACKAGES=true
      - N8N_COMMUNITY_PACKAGES_ENABLED=true
      - N8N_NODE_PATH=/home/node/.n8n/nodes
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true

      - N8N_SMTP_SENDER=${SMTP_EMAIL}
      - N8N_SMTP_USER=${SMTP_EMAIL}
      - N8N_SMTP_PASS=${SMTP_PASS}
      - N8N_SMTP_HOST=smtp.gmail.com
      - N8N_SMTP_PORT=465
      - N8N_SMTP_SSL=false

      - QUEUE_BULL_REDIS_HOST=n8n_redis
      - QUEUE_BULL_REDIS_PORT=6379
      - QUEUE_BULL_REDIS_DB=1

      - N8N_METRICS=true

      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=336

      - N8N_AI_ENABLED=false
      - N8N_AI_PROVIDER=openai
      - N8N_AI_OPENAI_API_KEY=${OPENAI_KEY}

      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash

      - GENERIC_TIMEZONE=America/Sao_Paulo
      - TZ=America/Sao_Paulo
      - N8N_DEFAULT_LOCALE=pt-BR
      
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          cpus: "1"
          memory: 1024M

## --------------------------- ORION --------------------------- ##

  n8n_redis:
    image: redis:latest
    command: [
        "redis-server",
        "--appendonly",
        "yes",
        "--port",
        "6379"
      ]

    volumes:
      - n8n_redis:/data

    networks:
      - rede

    #ports:
    #  - 6379:6379

    deploy:
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          cpus: "1"
          memory: 1024M

## --------------------------- ORION --------------------------- ##

volumes:
  n8n_redis:
    external: true
    name: n8n_redis

networks:
  rede:
    external: true
    name: rede

As suspected WEBHOOK_URL has a /webhook in it

Remove webhook/ from it, it needn’t have it. Then restart.

1 Like

Hi @jabbson,

I made the adjustment to the WEBHOOK_URL as you suggested and it worked perfectly. The URLs are now showing up in n8n without the extra /webhook.

I also tested the automation with the form and, as I suspected, the form_ending node now returns the completion message correctly.

Thanks a lot for your help! :folded_hands:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.