Hi,
I'm struggling with a random behavior where the "/" only work under certain conditions and I cannot understand why does not recognize correctly my dashy:
Rule configuration (I tested both and other random tests):
- "traefik.http.routers.{SERVICE}.rule=PathPrefix(`/`)"
- "traefik.http.routers.{SERVICE}.rule=Host(`my.domain.example`, `192.168.0.201`)"
It works for the example whoami docker and SOMETIMES in the dashy container.
If I move it to another docker-compose file with the same network configuration, it does not work except if I just specify one host only (and it only works sometimes).
I also have a transmission in another file which works the whole time ("traefik.http.routers.torrent.rule=PathPrefix(
/torrent)"
).
I don't know what options more to change, is not an issue to share the file, but it only works sometimes, which is also frustrating.
Here the full docker-compose.yml
(I've just duplicated the dashy
settings). Of course only dashy or whoami runs at the same time:
version: '3.7'
services:
traefik:
container_name: traefik
image: traefik:v2.9
restart: unless-stopped
ports:
- 81:80
- 444:443
environment:
- PUID=1026
- PGID=100
- TZ=Europe/Madrid
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /volume2/virtualization/docker/traefik:/etc/traefik
- /volume2/virtualization/docker/traefik/letsencrypt/:/letsencrypt
command:
- '--api=true'
- '--api.dashboard=true'
- '--api.insecure=true'
- '--pilot.dashboard=false'
- '--global.sendAnonymousUsage=false'
- '--global.checkNewVersion=false'
- '--log=true'
- '--log.level=DEBUG'
- '--log.filepath=/config/traefik.log'
- '--providers.docker=true'
- '--providers.docker.exposedByDefault=false'
- '--entryPoints.web=true'
- '--entryPoints.web.address=:8080/tcp'
- '--entryPoints.web.http.redirections.entryPoint.to=https'
- '--entryPoints.web.http.redirections.entryPoint.scheme=https'
## Please see the Forwarded Header Trust section of the Authelia Traefik Integration documentation.
# - '--entryPoints.web.forwardedHeaders.trustedIPs=10.0.0.0/8,172.16.0.0/16,192.168.0.0/16,fc00::/7'
# - '--entryPoints.web.proxyProtocol.trustedIPs=10.0.0.0/8,172.16.0.0/16,192.168.0.0/16,fc00::/7'
- '--entryPoints.web.forwardedHeaders.insecure=false'
- '--entryPoints.web.proxyProtocol.insecure=false'
- '--entryPoints.websecure=true'
- '--entryPoints.websecure.address=:443'
## Please see the Forwarded Header Trust section of the Authelia Traefik Integration documentation.
# - '--entryPoints.websecure.forwardedHeaders.trustedIPs=10.0.0.0/8,172.16.0.0/16,192.168.0.0/16,fc00::/7'
# - '--entryPoints.websecure.proxyProtocol.trustedIPs=10.0.0.0/8,172.16.0.0/16,192.168.0.0/16,fc00::/7'
- '--entryPoints.websecure.forwardedHeaders.insecure=false'
- '--entryPoints.websecure.proxyProtocol.insecure=false'
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
#- "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.letsencrypt.acme.email=nas@domain.example"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
networks:
- mynetwork
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.nas.domain.example`)"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- traefik.http.routers.dashboard.tls=true
- "traefik.http.routers.dashboard.service=api@internal"
# - 'traefik.http.routers.dashboard.middlewares=authelia@docker'
- traefik.http.routers.dashboard.tls.certresolver=letsencrypt
# depends_on:
# - authelia
## whoami - Hacer pruebas de la red y la ruta y los certificados
whoami:
container_name: whoami
image: traefik/whoami
networks:
- mynetwork
labels:
- "traefik.enable=true"
# BOTH WORKS HERE
# - "traefik.http.routers.whoami.rule=Host(`my.domain.example`, `192.168.0.201`)"
- "traefik.http.routers.whoami.rule=PathPrefix(`/`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=letsencrypt"
- "traefik.http.routers.whoami.tls=true"
dashy:
image: lissy93/dashy
container_name: dashy
restart: "unless-stopped"
environment:
- NODE_ENV=production
- PUID=1026
- PGID=100
volumes:
- /volume2/virtualization/docker/dashy/conf.yml:/app/public/conf.yml
networks:
- mynetwork
ports:
- 8000:80
labels:
- "traefik.enable=true"
# NO ONE WORKS HERE
- "traefik.http.routers.home.rule=PathPrefix(`/`)"
# - "traefik.http.routers.home.rule=Host(`my.domain.example`, `192.168.0.201`)"
# - "traefik.http.services.home.loadbalancer.server.port=80"
- "traefik.http.routers.home.entrypoints=websecure"
- "traefik.http.routers.home.tls.certresolver=letsencrypt"
- "traefik.http.routers.home.tls=true"
networks:
mynetwork:
name: mynetwork
driver: bridge
The debug console does not provide any issue, and also the log files are not working (maybe permissions, maybe path, I'm trying to solve it apart).
traefik.yml:
global:
checkNewVersion: false
sendAnonymousUsage: true
api:
insecure: true
dashboard: true
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: "websecure"
scheme: "https"
websecure:
address: ":443"
certificatesResolvers:
letsencrypt:
acme:
email: "ruben@racs.es"
storage: "/letsencrypt/acme.json"
httpChallenge:
entryPoint: web
dnsChallenge:
provider: "manual"
delayBeforeCheck: "10"
# domains:
# main: "*.racs.es"
providers:
docker:
# defaultRule: "Host(`{{ trimPrefix `/` .Name }}.rac2.asuscomm.com`)"
# defaultRule: "Host(`rac2.asuscomm.com/{{ trimPrefix `/` .Name }}`)"
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: true
watch: true
# file:
# filename: /etc/traefik/dynamic-config.yml
Thanks for the help in advance.