I installed Traefik some months ago and it works really well with my one service.
So I created a new one,based on the first service, and it doesn't work, I'm getting 404 when I try to reach it.
But not error in the logs, and I can see my two services in my dashboard and everything else seems working well.
here are my different conf files:
docker-compose.yml
version: '3'
services:
reverse-proxy:
restart: unless-stopped
image: traefik:v2.9.4
ports:
- "443:443"
- "82:82"
volumes:
- /home/pi/traefik/traefik.yml:/etc/traefik/traefik.yml
- /home/pi/traefik/services.yml:/etc/traefik/services.yml
- /var/run/docker.sock:/var/run/docker.sock
- /home/pi/traefik/acme.json:/acme.json
labels:
- "traefik.http.routers.api.rule=Host(`192.168.1.18`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.api.service=api@internal"
# - "traefik.http.routers.api.entrypoints=https"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=myuser:mypassworkd"
- "traefik.http.routers.traccar.entrypoints=http,https"
- "traefik.http.routers.traccar.rule=Host(`myhost.com`) && (PathPrefix(`/traccar`)) "
- "traefik.http.routers.traccar.service=traccar@file"
- "traefik.http.routers.traccar.tls=true"
- "traefik.http.routers.traccar.tls.certresolver=pi"
- "traefik.http.routers.transmission.entrypoints=http,https"
- "traefik.http.routers.transmission.rule=Host(`myhost.com`) && (PathPrefix(`/transmission`)) "
- "traefik.http.routers.transmission.service=transmission@file"
- "traefik.http.routers.transmission.tls=true"
- "traefik.http.routers.transmission.tls.certresolver=pi"
traefik.yml
entryPoints:
http:
address: ':82'
https:
address: ':443'
log:
filePath: /var/log/traefik/traefik.log
level: DEBUG
accessLog:
filePath: /var/log/traefik/access.log
api:
dashboard: true
providers:
docker:
endpoint: 'unix:///var/run/docker.sock'
file:
filename: /etc/traefik/services.yml
certificatesResolvers:
pi:
acme:
email: mymail@mail.com
storage: acme.json
httpChallenge:
entryPoint: http
services.yml
http:
services:
transmission:
loadBalancer:
servers:
- url: 'http://192.168.1.18:9091/'
traccar:
loadBalancer:
servers:
- url: 'http://192.168.1.18:8082/'
And finally, here is my traefik.log
time="2022-11-20T09:52:33Z" level=info msg="Traefik version 2.9.4 built on 2022-10-27T18:44:34Z"
time="2022-11-20T09:52:33Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":82\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"https\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmModeRefreshSeconds\":\"15s\"},\"file\":{\"watch\":true,\"filename\":\"/etc/traefik/services.yml\"}},\"api\":{\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"filePath\":\"/var/log/traefik/traefik.log\",\"format\":\"common\"},\"accessLog\":{\"filePath\":\"/var/log/traefik/access.log\",\"format\":\"common\",\"filters\":{},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}}},\"certificatesResolvers\":{\"pi\":{\"acme\":{\"email\":\"mymail@mail.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"acme.json\",\"keyType\":\"RSA4096\",\"certificatesDuration\":2160,\"httpChallenge\":{\"entryPoint\":\"http\"}}}}}"
time="2022-11-20T09:52:33Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n"
time="2022-11-20T09:52:33Z" level=info msg="Starting provider aggregator aggregator.ProviderAggregator"
time="2022-11-20T09:52:33Z" level=debug msg="Starting TCP Server" entryPointName=http
time="2022-11-20T09:52:33Z" level=debug msg="Starting TCP Server" entryPointName=https
time="2022-11-20T09:52:33Z" level=info msg="Starting provider *file.Provider"
time="2022-11-20T09:52:33Z" level=debug msg="*file.Provider provider configuration: {\"watch\":true,\"filename\":\"/etc/traefik/services.yml\"}"
time="2022-11-20T09:52:34Z" level=info msg="Starting provider *traefik.Provider"
time="2022-11-20T09:52:34Z" level=debug msg="*traefik.Provider provider configuration: {}"
time="2022-11-20T09:52:34Z" level=info msg="Starting provider *docker.Provider"
time="2022-11-20T09:52:34Z" level=debug msg="*docker.Provider provider configuration: {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmModeRefreshSeconds\":\"15s\"}"
time="2022-11-20T09:52:34Z" level=info msg="Starting provider *acme.Provider"
time="2022-11-20T09:52:34Z" level=debug msg="*acme.Provider provider configuration: {\"email\":\"mymail@mail.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"acme.json\",\"keyType\":\"RSA4096\",\"certificatesDuration\":2160,\"httpChallenge\":{\"entryPoint\":\"http\"},\"ResolverName\":\"pi\",\"store\":{},\"TLSChallengeProvider\":{},\"HTTPChallengeProvider\":{}}"
time="2022-11-20T09:52:34Z" level=debug msg="Attempt to renew certificates \"720h0m0s\" before expiry and check every \"24h0m0s\"" providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory"
time="2022-11-20T09:52:34Z" level=info msg="Testing certificate renew..." ACME CA="https://acme-v02.api.letsencrypt.org/directory" providerName=pi.acme
time="2022-11-20T09:52:34Z" level=info msg="Starting provider *acme.ChallengeTLSALPN"
time="2022-11-20T09:52:34Z" level=debug msg="*acme.ChallengeTLSALPN provider configuration: {}"
time="2022-11-20T09:52:34Z" level=debug msg="Configuration received: {\"http\":{\"services\":{\"traccar\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://192.168.1.18:8082/\"}],\"passHostHeader\":true}},\"transmission\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://192.168.1.18:9091/\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{},\"tls\":{}}" providerName=file
time="2022-11-20T09:52:34Z" level=debug msg="Configuration received: {\"http\":{\"routers\":{\"acme-http\":{\"entryPoints\":[\"http\"],\"service\":\"acme-http@internal\",\"rule\":\"PathPrefix(`/.well-known/acme-challenge/`)\",\"priority\":2147483647}},\"services\":{\"acme-http\":{},\"api\":{},\"dashboard\":{},\"noop\":{}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"udp\":{},\"tls\":{}}" providerName=internal
time="2022-11-20T09:52:34Z" level=debug msg="Configuration received: {\"http\":{},\"tcp\":{},\"udp\":{},\"tls\":{}}" providerName=pi.acme
time="2022-11-20T09:52:34Z" level=debug msg="Provider connection established with docker 20.10.21 (API 1.41)" providerName=docker
time="2022-11-20T09:52:34Z" level=debug msg="Configuration received: {\"http\":{\"routers\":{\"api\":{\"middlewares\":[\"auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`192.168.1.18`) \\u0026\\u0026 (PathPrefix(`/api`) || PathPrefix(`/dashboard`))\"},\"traccar\":{\"entryPoints\":[\"http\",\"https\"],\"service\":\"traccar@file\",\"rule\":\"Host(`myhost.com`) \\u0026\\u0026 (PathPrefix(`/traccar`)) \",\"tls\":{\"certResolver\":\"pi\"}},\"transmission\":{\"entryPoints\":[\"http\",\"https\"],\"service\":\"transmission@file\",\"rule\":\"Host(`myhost.com`) \\u0026\\u0026 (PathPrefix(`/transmission`)) \",\"tls\":{\"certResolver\":\"pi\"}}},\"services\":{\"reverse-proxy-traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.19.0.2:80\"}],\"passHostHeader\":true}}},\"middlewares\":{\"auth\":{\"basicAuth\":{\"users\":[\"myuser:mypassword\"]}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
time="2022-11-20T09:52:35Z" level=debug msg="No default certificate, fallback to the internal generated certificate" tlsStoreName=default
time="2022-11-20T09:52:35Z" level=debug msg="Added outgoing tracing middleware acme-http@internal" entryPointName=http routerName=acme-http@internal middlewareName=tracing middlewareType=TracingForwarder
time="2022-11-20T09:52:35Z" level=debug msg="Creating middleware" middlewareName=traefik-internal-recovery middlewareType=Recovery entryPointName=http
time="2022-11-20T09:52:35Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [http https]" routerName=api
time="2022-11-20T09:52:35Z" level=debug msg="Adding certificate for domain(s) myhost.com"
time="2022-11-20T09:52:36Z" level=debug msg="No default certificate, fallback to the internal generated certificate" tlsStoreName=default
time="2022-11-20T09:52:36Z" level=debug msg="Added outgoing tracing middleware api@internal" routerName=api@docker middlewareName=tracing middlewareType=TracingForwarder entryPointName=https
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" entryPointName=https middlewareName=auth@docker middlewareType=BasicAuth routerName=api@docker
time="2022-11-20T09:52:36Z" level=debug msg="Adding tracing to middleware" entryPointName=https routerName=api@docker middlewareName=auth@docker
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" entryPointName=https middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2022-11-20T09:52:36Z" level=debug msg="Added outgoing tracing middleware acme-http@internal" middlewareName=tracing middlewareType=TracingForwarder entryPointName=http routerName=acme-http@internal
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining entryPointName=http routerName=transmission@docker serviceName=transmission@file
time="2022-11-20T09:52:36Z" level=debug msg="Creating load-balancer" entryPointName=http routerName=transmission@docker serviceName=transmission@file
time="2022-11-20T09:52:36Z" level=debug msg="Creating server 0 http://192.168.1.18:9091/" entryPointName=http routerName=transmission@docker serviceName=transmission@file serverName=0
time="2022-11-20T09:52:36Z" level=debug msg="child http://192.168.1.18:9091/ now UP"
time="2022-11-20T09:52:36Z" level=debug msg="Propagating new UP status"
time="2022-11-20T09:52:36Z" level=debug msg="Added outgoing tracing middleware transmission@file" entryPointName=http routerName=transmission@docker middlewareName=tracing middlewareType=TracingForwarder
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining entryPointName=http routerName=traccar@docker serviceName=traccar@file
time="2022-11-20T09:52:36Z" level=debug msg="Creating load-balancer" serviceName=traccar@file entryPointName=http routerName=traccar@docker
time="2022-11-20T09:52:36Z" level=debug msg="Creating server 0 http://192.168.1.18:8082/" entryPointName=http routerName=traccar@docker serviceName=traccar@file serverName=0
time="2022-11-20T09:52:36Z" level=debug msg="child http://192.168.1.18:8082/ now UP"
time="2022-11-20T09:52:36Z" level=debug msg="Propagating new UP status"
time="2022-11-20T09:52:36Z" level=debug msg="Added outgoing tracing middleware traccar@file" middlewareType=TracingForwarder middlewareName=tracing entryPointName=http routerName=traccar@docker
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2022-11-20T09:52:36Z" level=debug msg="Creating middleware" middlewareType=Recovery entryPointName=https middlewareName=traefik-internal-recovery
time="2022-11-20T09:52:36Z" level=debug msg="Adding route for myhost.com with TLS options default" entryPointName=https
time="2022-11-20T09:52:36Z" level=debug msg="Adding route for myhost.com with TLS options default" entryPointName=http
time="2022-11-20T09:52:36Z" level=debug msg="Trying to challenge certificate for domain [myhost.com] found in HostSNI rule" routerName=traccar@docker rule="Host(`myhost.com`) && (PathPrefix(`/traccar`)) " providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory"
time="2022-11-20T09:52:36Z" level=debug msg="Trying to challenge certificate for domain [myhost.com] found in HostSNI rule" providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" rule="Host(`myhost.com`) && (PathPrefix(`/transmission`)) " routerName=transmission@docker
time="2022-11-20T09:52:36Z" level=debug msg="Looking for provided certificate(s) to validate [\"myhost.com\"]..." rule="Host(`myhost.com`) && (PathPrefix(`/traccar`)) " providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" routerName=traccar@docker
time="2022-11-20T09:52:36Z" level=debug msg="Looking for provided certificate(s) to validate [\"myhost.com\"]..." providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" rule="Host(`myhost.com`) && (PathPrefix(`/transmission`)) " routerName=transmission@docker
time="2022-11-20T09:52:36Z" level=debug msg="No ACME certificate generation required for domains [\"myhost.com\"]." providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" rule="Host(`myhost.com`) && (PathPrefix(`/transmission`)) " routerName=transmission@docker
time="2022-11-20T09:52:36Z" level=debug msg="No ACME certificate generation required for domains [\"myhost.com\"]." rule="Host(`myhost.com`) && (PathPrefix(`/traccar`)) " providerName=pi.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory" routerName=traccar@docker
Thanks in advance for the help