hey,
im reay new to traefik
i hope anyone can help me quick fix my little problem
i have get it work to access subdomains after authelia to one container in docker, with different ports, it works, but i get a lot of errors from traefik and cant figure out the issue
the errors like:
'evel=error msg="Could not define the service name for the router: too many services" providerName=docker routerName=jarvis'
here my labels:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
## iobroker
- "traefik.http.routers.iobroker.entrypoints=http"
- "traefik.http.routers.iobroker.rule=Host(`iobroker.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.iobroker.middlewares=secure-https-redirect"
- "traefik.http.routers.iobroker-secure.entrypoints=https"
- "traefik.http.routers.iobroker-secure.rule=Host(`iobroker.my.domain.de`)"
- "traefik.http.routers.iobroker-secure.tls=true"
- "traefik.http.routers.iobroker-secure.tls.certresolver=http"
- "traefik.http.routers.iobroker-secure.service=iobroker"
- "traefik.http.services.iobroker.loadbalancer.server.port=8081"
- "traefik.http.routers.iobroker-secure.middlewares=middlewares-authelia@file"
## Web
- "traefik.http.routers.web.entrypoints=http"
- "traefik.http.routers.web.rule=Host(`web.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect-web.redirectscheme.scheme=https"
- "traefik.http.routers.web.middlewares=secure-https-redirect-web"
- "traefik.http.routers.web-secure.entrypoints=https"
- "traefik.http.routers.web-secure.rule=Host(`web.my.domain.de`)"
- "traefik.http.routers.web-secure.tls=true"
- "traefik.http.routers.web-secure.tls.certresolver=http"
- "traefik.http.routers.web-secure.service=web"
- "traefik.http.services.web.loadbalancer.server.port=8082"
- "traefik.http.routers.web-secure.middlewares=middlewares-authelia@file"
## jarvis
- "traefik.http.routers.jarvis.entrypoints=http"
- "traefik.http.routers.jarvis.rule=Host(`jarvis.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect-jarvis.redirectscheme.scheme=https"
- "traefik.http.routers.jarvis.middlewares=secure-https-redirect-jarvis"
- "traefik.http.routers.jarvis-secure.entrypoints=https"
- "traefik.http.routers.jarvis-secure.rule=Host(`jarvis.my.domain.de`)"
- "traefik.http.routers.jarvis-secure.tls=true"
- "traefik.http.routers.jarvis-secure.tls.certresolver=http"
- "traefik.http.routers.jarvis-secure.service=jarvis"
- "traefik.http.services.jarvis.loadbalancer.server.port=8400"
- "traefik.http.routers.jarvis-secure.middlewares=middlewares-authelia@file"
Hello @softwarecrash and thanks for your interest in Traefik,
The error Could not define the service name for the router: too many services
is raised when Traefik cannot automatically choose which service is attached to a router.
Even if you are configuring a redirect middleware a service needs to be attached to the iobroker
, web
, and jarvis
routers. That's why Traefik is trying to configure a service automatically for the above routers and cannot infer one because of multiple service definitions.
Here is a fixed version of your configuration (noop@internal
is a service which does nothing):
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
## iobroker
- "traefik.http.routers.iobroker.entrypoints=http"
- "traefik.http.routers.iobroker.rule=Host(`iobroker.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.iobroker.middlewares=secure-https-redirect"
- "traefik.http.routers.iobroker.service=noop@internal" # <--- Fix Service configuration
- "traefik.http.routers.iobroker-secure.entrypoints=https"
- "traefik.http.routers.iobroker-secure.rule=Host(`iobroker.my.domain.de`)"
- "traefik.http.routers.iobroker-secure.tls=true"
- "traefik.http.routers.iobroker-secure.tls.certresolver=http"
- "traefik.http.routers.iobroker-secure.service=iobroker"
- "traefik.http.services.iobroker.loadbalancer.server.port=8081"
- "traefik.http.routers.iobroker-secure.middlewares=middlewares-authelia@file"
## Web
- "traefik.http.routers.web.entrypoints=http"
- "traefik.http.routers.web.rule=Host(`web.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect-web.redirectscheme.scheme=https"
- "traefik.http.routers.web.middlewares=secure-https-redirect-web"
- "traefik.http.routers.web.service=noop@internal" # <--- Fix Service configuration
- "traefik.http.routers.web-secure.entrypoints=https"
- "traefik.http.routers.web-secure.rule=Host(`web.my.domain.de`)"
- "traefik.http.routers.web-secure.tls=true"
- "traefik.http.routers.web-secure.tls.certresolver=http"
- "traefik.http.routers.web-secure.service=web"
- "traefik.http.services.web.loadbalancer.server.port=8082"
- "traefik.http.routers.web-secure.middlewares=middlewares-authelia@file"
## jarvis
- "traefik.http.routers.jarvis.entrypoints=http"
- "traefik.http.routers.jarvis.rule=Host(`jarvis.my.domain.de`)"
- "traefik.http.middlewares.secure-https-redirect-jarvis.redirectscheme.scheme=https"
- "traefik.http.routers.jarvis.middlewares=secure-https-redirect-jarvis"
- "traefik.http.routers.jarvis.service=noop@internal" # <--- Fix Service configuration
- "traefik.http.routers.jarvis-secure.entrypoints=https"
- "traefik.http.routers.jarvis-secure.rule=Host(`jarvis.my.domain.de`)"
- "traefik.http.routers.jarvis-secure.tls=true"
- "traefik.http.routers.jarvis-secure.tls.certresolver=http"
- "traefik.http.routers.jarvis-secure.service=jarvis"
- "traefik.http.services.jarvis.loadbalancer.server.port=8400"
- "traefik.http.routers.jarvis-secure.middlewares=middlewares-authelia@file"
Please note that instead of configuring a redirect middleware on each router, you can configure the redirection at the entrypoint level as explained in the following documentation: Traefik EntryPoints Documentation - Traefik
Hope this helps!
thank you so much for the help, all erros are gone.
i will further read the docs, but its a hard learning curve when never bevor worked with traefik
system
Closed
September 26, 2022, 8:22am
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.