Why Do I Get a 404 When Calling Portainer via Traefik
I Have the Problem That I Get a 404 When I Want to Call My Portainer-Container via Traefik These Are My Labels for Portainer: - "Traefik. Enable=True"...
I have the problem that I get a 404 when I want to call my portainer-container via traefik
These are my labels for portainer:
- "traefik.enable=true"
- "traefik.http.routers.portainer.rule=Host(`portainer.domain.de`)"
- "traefik.port=9000"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.portainer.entrypoints=websecure"
- "traefik.http.routers.portainer.tls.certresolver=myresolver"
Traefik works just fine because other containers with similar config working perfectly
2 Answers
This is the same question as this thread Traefik v2.5 not redirecting to portainer container. 404 Not Found
Answer is Portainer doesnt support subpaths yet but it can be a feature request for the future.
Although late, I hope this might be helpful to others: I found that the documentation around Portainer+Traefik v2 is inconsistent at best. Even the official Portainer Documentation is not presenting a valid solution.
If you are at the beginning and are trying for the first time to make them works, this is what got me through:
traefik.enable=true
traefik.http.routers.portainer.rule=Host(`yourown.url.extension`)
traefik.http.routers.portainer.entrypoints=websecure
traefik.http.routers.portainer.tls.certresolver=myresolver
traefik.http.routers.portainer.service=portainer
traefik.http.services.portainer.loadbalancer.server.port=9000
traefik.http.routers.portainer-edge.rule=Host(`yourownedge.url.extension`)
traefik.http.routers.portainer-edge.entrypoints=websecure
traefik.http.routers.portainer-edge.tls.certresolver=myresolver
traefik.http.routers.portainer-edge.service=portainer-edge
traefik.http.services.portainer-edge.loadbalancer.server.port=8000
Please note: in my configuration "myresolver" is the name of the certresolver service. You should change it appropriately.