After reading documentation and some blog posts I created simple traefik configuration and deployed it to docker swarm mode:
cat traefik-simple.yaml
version: '3.6'
services:
reverse-proxy:
image: traefik:v2.0.2
command:
- "--log.level=DEBUG"
- "--accesslog=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--api=true"
- "--api.dashboard=true"
- "--providers.docker.swarmMode=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=app-entry"
- "--entrypoints.web.address=:80"
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- app-entry
labels:
- "traefik.enable=true"
- "traefik.docker.network=app-entry"
- "traefik.http.routers.traefik.rule=Host(`my-host.example.com`)"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
- "traefik.http.services.traefik.loadbalancer.server.port=1337"
deploy:
placement:
constraints:
- node.role == manager
networks:
app-entry:
name: app-entry
external: true
And now I get 404 using curl -vvv my-host.example.com
In access logs I see my dashboard requests and some strange things:
level=debug msg="Filtering disabled container" providerName=docker container=traefik-reverse-proxy-s06oi6rica8mbrzfl73gf7ewt
What's going wrong? Thanks in advance.