Does anyone have any idea why I'm experiencing this symptom? Appreciate any help you can offer. Thanks much, in advance.
Complete newbie here. I have finally gotten a simple test page to work with Traefik. I have been trying, for about 4 hours now, to just grok it all, get simple things running, and get the dashboard loaded. Its' this latter that I'm currently struggling with. Not only does the dashboard not come up, but my single page test site stops working.
I'm running a separate console just for tail
on the log file. When I uncomment the api
lines in the traefik.yml file, I can tell it's not going to work as soon as the docker compose up
finishes. I'll get this line in the logs (going to very much shorten it):
time="2024-04-26T04:06:25Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"custom\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"readTimeout\":\"1m0s\",\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\".....
... and then I get nothing else. With the api
config entries commented out, I get a whole bunch of stuff (I have debug logging turned on, obviously), this is just a portion. (You can see the last part of the JSON content log entry there.
(Please note: There's a different domain name, just using "myserver.com" in config and images.)
Here's the good:
Here's the docker-compose:
services:
reverse-proxy:
image: traefik:v2.11
# Commented this out, seems like it can find it just fine.
#command: --configFile=/etc/traefik/traefik.yml
# Tried to add here as command flags vs. being in the config file.
#command: --configFile=/etc/traefik/traefik.yml --api.dashboard=true --api.insecure=true --providers.docker
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik.yml:/etc/traefik/traefik.yml:ro
- ./config/certs/:/etc/traefik/certs/
- ./log/traefik/:/var/log/traefik/
- ./data/acme.json:/acme/acme.json
networks:
- traefik
nginx_test:
image: nginx
# ports:
# - 80:80
networks:
- traefik
volumes:
- ./html:/usr/share/nginx/html:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.nginx-http.rule=Host(`test1.myserver.com`)"
#- "traefik.http.routers.web.rule=Host(`host1.example.com`) || Host(`host2.example.com`) || Host(`host3.random.com`)"
- "traefik.http.routers.nginx-http.entrypoints=web"
- "traefik.http.routers.nginx-http.service=nginx-http-service"
- "traefik.http.services.nginx-http-service.loadbalancer.server.port=80"
# Have tried with and without this section
# - "traefik.http.routers.traefik-dashboard.rule=Host(`test2.myserver.com`)"
# - "traefik.http.routers.traefik-dashboard.entrypoints=web"
# - "traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080"
# - "traefik.http.routers.traefik-dashboard.service=traefik-dashboard"
depends_on:
- reverse-proxy
networks:
traefik:
external: true
Here's the traefik.yml:
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
custom:
address: ":8080"
# --------------------------------------------------
# If I uncomment these, it completely stops working
# --------------------------------------------------
# api:
# dashboard: true
# insecure: true
# --------------------------------------------------
log:
level: DEBUG
format: common
filePath: /var/log/traefik/traefik.log
certificatesResolvers:
dwo-resolver:
acme:
email: nobody@example.com
storage: acme.json
httpChallenge:
entryPoint: web
providers:
docker:
exposedByDefault: false
file:
directory: /etc/traefik/
watch: true