Dear all, iam struggeling very hard on following problem:
Iam using traefik proxy with a frontend on port 5000 and a backend on port 8080.
Frontend serves well and HTTPS TLS stuff works well. backend returns a 504 timeout. Following this issue here is what the traefik logs says:
level=error msg="Unable to create redirection: the entry point or the port is missing" providerName=internal entryPointName=backend
Please see my configuration for traefik:
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:2.4
networks:
- web
ports:
- "80:80"
- "443:443"
- "5000:5000" # Angular ssr frontend
- "8080:8080" # NodeJS backend
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./acme.json:/acme.json
- ./traefik.yml:/traefik.yml
networks:
web:
external: true
the traefik.yml looks as follows. As i understand it, under entryPoints there is a backend point configurered. Or am i wrong?
entryPoints:
web:
address: ':80'
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ':443'
backend:
address: ':8080'
http:
tls:
certResolver: lets-encrypt
redirections:
entryPoint:
scheme: https
certificatesResolvers:
lets-encrypt:
acme:
email: mymail@mail.com
storage: acme.json
tlsChallenge: {}
providers:
docker:
watch: true
network: web
exposedByDefault: false
Now the backend configuration looks like this:
version: '3'
services:
backend:
image: node:latest
command: node /usr/src/app/index.js
volumes:
- ./dist:/usr/src/app
networks:
- default
- web
labels:
- traefik.enable=true
- traefik.http.routers.backend.rule=Host(`backend.my-domain.de`) && PathPrefix(`/{path:.*}`)
- traefik.http.routers.backend.tls=true
- traefik.http.routers.backend.tls.certresolver=lets-encrypt
- traefik.http.services.backend.loadbalancer.server.port=8080
networks:
web:
external: true
Watching the web network details, it looks fine as well:
[
{
"Name": "web",
"Id": "4fcc2d0dab99981fb712b7ec1e82c4a36cb920663334d3b0eaaf1470054ab344",
"Created": "2024-08-01T10:33:35.364129457Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"09f224180714684bc5c02c37e9d100a1f314e760fdf7473d08f3b607a7872a48": {
"Name": "frontend-frontend-1",
"EndpointID": "516a27cbb4b551cef109b78371c91c30c709658d4e0de5f2afb2987dcb0b3bf8",
"MacAddress": "02:42:ac:12:00:04",
"IPv4Address": "172.18.0.4/16",
"IPv6Address": ""
},
"c893aa1799b26b6063b2e6d422420ac2cd27bc7b74927b8dfaad114a9a42bfdb": {
"Name": "backend-backend-1",
"EndpointID": "a54a8dc97d0f0bc66d0db4a79e510e1e11d922eaa3bbb73c9447d8b4c0af0f94",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"fbbdb2e5d79ded7d4ae2a09b116315309b4e0915f952ab0beab377c068e7bda3": {
"Name": "prod-traefik-1",
"EndpointID": "3310901ec21dcfef8193014000395fd7ccd90ec7474aa9e8e5a992b9fcca62f7",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
Iam really desperate, since the setup above was working in the past and following normal patters did not show anything wrong here. What am i missing? I would be really appriciate for any help. Regards Marc