I am running into this issue with the latest version of traefik and portainer - I can access portainer from the direct IP address assigned to it, however when I tried to access it via a host name through traefik I get a 404 error
Note: The traefik config below is working for about a dozen other containers -- its seems that portainer is behaving a little differently though?
Here is my portainer compose file
networks:
monitoring:
external: true
name: monitoring
services:
portainer:
container_name: portainer
image: portainer/portainer
labels:
traefik.docker.network: monitoring
traefik.enable: "true"
traefik.http.routers.portainer.entrypoints: websecure
traefik.http.routers.portainer.rule: Host(`portainer.home.local`)
networks:
monitoring: {}
restart: always
volumes:
- /dockerdata/portainer/data:/data:rw
- /var/run/docker.sock:/var/run/docker.sock:rw
Here is my traefik compose file
networks:
data:
external: true
name: data
logging:
external: true
name: logging
media:
external: true
name: media
monitoring:
external: true
name: monitoring
public:
external: true
name: public
services:
traefik:
command:
- --log.level=DEBUG
- --accesslog=true
- --providers.docker=true
- --providers.docker.endpoint=unix:///var/run/docker.sock
- --providers.docker.exposedbydefault=false
- --providers.docker.useBindPortIP=true
- --providers.file.directory=/etc/traefik/dynamic
- --providers.file.watch=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --certificatesresolvers.secureresolver.acme.httpchallenge=true
- --certificatesresolvers.secureresolver.acme.httpchallenge.entrypoint=web
- --certificatesresolvers.secureresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.secureresolver.acme.email=me@domain.com
- --certificatesresolvers.secureresolver.acme.storage=/letsencrypt/acme.json
- --serverstransport.insecureskipverify=true
container_name: traefik
image: traefik:latest
labels:
com.centurylinklabs.watchtower.enable: "true"
traefik.enable: "true"
traefik.http.routers.dashboard.entryPoints: traefik
traefik.http.routers.dashboard.rule: PathPrefix(`/api`) || PathPrefix(`/dashboard`)
treafik.http.routers.dashboard.service: api@internal
networks:
data: {}
logging: {}
media: {}
monitoring: {}
public: {}
ports:
- published: 80
target: 80
- published: 443
target: 443
- published: 8080
target: 8080
restart: always
volumes:
- /docker/traefik/data/certs:/certs:rw
- /docker/traefik/data/traefik:/etc/traefik/dynamic:rw
- /docker/traefik/data/letsencrypt:/letsencrypt:rw
- /var/run/docker.sock:/var/run/docker.sock:ro