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"
- "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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest