I have tried everything and I'm pulling my hair out just trying to get Traefik to work
My Docker-Compose:
version: "3.3"
services:
traefik:
image: traefik:v2.11
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
web: # <== Placing traefik on the network named web, to access containers on this network
ports:
- "80:80" # <== http
- "8080:8080" # <== :8080 is where the dashboard runs on
- "443:443" # <== https
environment:
- CF_API_EMAIL=<email>
- CF_DNS_API_TOKEN=<token>
# - CF_API_KEY=YOU_API_KEY
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro # <== Volume for docker admin
- /mnt/storage/files/devhome/traefik/traefik.yml:/traefik.yml:ro
- /mnt/storage/files/devhome/traefik/acme.json:/acme.json
- /mnt/storage/files/devhome/traefik/logs:/var/log/traefik
labels:
- "traefik.enable=true" # <== Enable traefik on itself to view dashboard and assign subdomain to$
- "traefik.http.routers.endpoints=http"
- "traefik.http.routers.rule=Host('monitor.vryreal.com')"
- "traefik.middlewares.traefik-auth.basicauth.users=<user>:<password>"
- "traefik.middlewares.traefik_https-redirect.redirectscheme.scheme=https"
- "traefik.middlewares.sslheader.headers.customerrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host('monitor.vryreal.com')"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certificatesresolvers=cloudflare"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=vryreal.com"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.vryreal.com"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
web:
external: true
Here is my traefik.yml
log:
level: DEBUG
api:
dashboard: true
debug: true
entryPoints:
http:
address: :80
redirections:
to: https
scheme: https
https:
address: :443
serversTransport:
insecureSkipVerify: true
certificatesResolvers:
cloudflare:
acme:
email: "<email>" # Email address used for registration
storage: "acme.json" # File or key used for certificates storage
dnsChallenge:
providers: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
network: traefik
file:
filename: "dynamic.yml"
And here is my dynamic.yml
## Setting up the middleware for redirect to https ##
http:
middlewares:
redirect:
redirectScheme:
scheme: https
I continue to get this error no matter WHAT
command traefik error: field not found, node: providers
Please help!!!