Self Hosted Webhook Not Working

Hello.

I’m new to self hosting n8n and i’m having trouble with my webhook.

I think the issue is my webhook trails with my port forward (5678). Example: https://app.domain.co.uk:5678/webhook-test/teams

I’ve created an A record in my DNS to separate production and website.

But, I can’t even hit the webhook using curl in terminal now.

here is my current yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: n8n-svc
namespace: bots
spec:
replicas: 1
selector:
matchLabels:
app: n8n
template:
metadata:
labels:
app: n8n
spec:
containers:
- name: n8n
image: n8nio/n8n:latest
ports:
- containerPort: 5678
env:
- name: DB_TYPE
value: postgresdb
- name: DB_POSTGRESDB_HOST
value: n8n-postgres-postgresql
- name: DB_POSTGRESDB_PORT
value: “5432”
- name: DB_POSTGRESDB_DATABASE
value: n8ndb
- name: DB_POSTGRESDB_USER
value: n8n
- name: DB_POSTGRESDB_PASSWORD
valueFrom:
secretKeyRef:
name: n8n-postgresql
key: postgres-password
- name: N8N_HOST
value: app.domain.co.uk
- name: N8N_PORT
value: “5678”
- name: N8N_PROTOCOL
value: https
- name: N8N_WEBHOOK_URL
value: https://app.domain.co.uk:5678
- name: GENERIC_TIMEZONE
value: Europe/London
volumeMounts:
- name: n8n-data
mountPath: /home/node/.n8n
volumes:
- name: n8n-data
emptyDir: {}

I’ve tried several changes to try and get the test URL to fire, but nothing seems to work.

I’m also using an ingressroute. But not sure this is needed?

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: n8n-webhook-route
namespace: bots
spec:
entryPoints:
- websecure
routes:
- match: PathPrefix(/webhook)
kind: Rule
middlewares:
- name: n8n-forwarded-headers
services:
- name: n8n-svc
port: 5678
- match: PathPrefix(/webhook-test)
kind: Rule
middlewares:
- name: n8n-forwarded-headers
services:
- name: n8n-svc
port: 5678
tls:
certResolver: default

Been stuck here for a few days now, any help would be amazing.

TIA, Luke

you are talking about ingress rt. where is this container hosted? is it hosted on AWS?

The webhook URL should not contain the port. Just set the base url without port.

Thanks so much for jumping in Sandy.

To clarify, we’re self-hosting n8n inside a Kubernetes cluster (non-AWS) using Traefik as our ingress controller. The n8n pod is deployed in the bots namespace, and we’re routing requests to it using an IngressRoute. Our DNS app.domain.co.uk points directly to Traefik’s LoadBalancer IP.

Here’s what we’ve configured:

TLS is handled by Traefik with the default cert resolver (currently showing Traefik’s self-signed cert while testing).
n8n-svc is a ClusterIP service that exposes port 5678 internally to the pod.
We’re using the following n8n environment variables:

yaml

We also tried setting N8N_WEBHOOK_URL=https://app.domain.co.uk (i.e. without the port), but that didn’t fix the issue.

Here’s what we’ve tried so far:

:white_check_mark: Created an IngressRoute with PathPrefix rules for /webhook and /webhook-test
:white_check_mark: Attached a middleware to inject the correct X-Forwarded-* headers
:white_check_mark: Verified that the workflow is active and has the correct webhookPath in Postgres
:white_check_mark: Restarted the n8n-svc deployment after each change
:white_check_mark: Tried removing port :5678 from both the ingress and environment settings
:white_check_mark: Issued curl requests to both:

https://app.domain.co.uk:5678/webhook-test/teams > connection refused
https://app.domain.co.uk/webhook-test/teams > 404 page not found

We also ran kubectl logs on the pod while sending the request — no logs are printed, so the request never hits the container.

We can access the UI via kubectl port-forward, but we’re not exposing the UI externally yet until webhooks work reliably. Given that port 5678 is internal, we’re assuming webhooks need to come in via Traefik on 443.

Happy to share any other config if needed

Any advice on where we’re going wrong would be hugely appreciated :folded_hands:

Hi @Jon hope you don’t mind me tagging you in this topic. I saw you helped another user out with a similar issue

can you try this
From a pod in the same namespace, run:

curl http://n8n-svc:5678/webhook-test/teams

If this returns a response, your service is fine; the issue could be with Traefik routing.

Hi Sandy,

I ran the curl and got

MacBookPro:~ luke$ curl http://n8n-svc:5678/webhook-test/teams

curl: (6) Could not resolve host: n8n-svc

I see you ran it from your macbook. try from inside the pod. you may need to install curl there.
also try this
curl https://app.domain.co.uk/webhook-test/teams

Hey Sandy,

Sorry for the late reply.

I got it fixed. I tore down Traefik and went another route.

Thanks for your help on this one.

I tried my best but sometimes starting from scratch is the right thing which you did.
Glad it worked. happy for you

BTW, I created a short on how I implement n8n for enterprises
you will appreciate it

Enterprise ready setup -check it out!:backhand_index_pointing_right: https://youtu.be/c7AAI2LoywM

Explainer Video - https://www.youtube.com/watch?v=ne0q45S1gww