neos
March 30, 2020, 10:13am
1
Hi,
I not locate the solution form my problema.
I add a filenale configuration extra , and i appear this error:
msg="Cannot start the provider *file.Provider: error reading configuration file: /etc/traefik/dyn-config.yml - open /etc/traefik/dyn-config.yml: no such file or directory"
in the traefik.yml i put this:
api:
insecure: true
dashboard: true
global:
checkNewVersion: true
sendAnonymousUsage: false
entryPoints:
http:
address: ":80"
https:
address: ":443"
certificatesResolvers:
http:
acme:
email: miemail@utlook.com
storage: acme.json
httpChallenge:
entryPoint: http
providers:
docker:
exposedByDefault: false
file:
filename: /etc/traefik/dyn-config.yml
watch: true
in the dyn-config file:
http:
services:
homeAssistant:
loadBalancer:
servers:
- url: "http://192.168.0.5:8123"
routers:
ha-http:
entryPoints:
- http
service: homeAssistant
middlewares:
- redirect
rule: "Host(`domain.subdomain.com`)"
ha-https:
entryPoints:
- https
service: homeAssistant
rule: "Host(`domain.subdomain.com`)"
tls:
certResolver:
middlewares:
redirect:
redirectScheme:
scheme: https
Where is the problem???
ldez
March 30, 2020, 10:22am
2
Hello,
the error is that /etc/traefik/dyn-config.yml
doesn't exist.
neos
March 30, 2020, 10:26am
3
the file exist!. i checked
ldez
March 30, 2020, 10:27am
4
the error is clear.
How do you start your Traefik? Are you using Docker? Have you mount the file in the right directory?
neos
March 30, 2020, 10:30am
5
Yes, i use docker read this guide, https://medium.com/@containeroo/traefik-2-0-route-external-services-through-traefik-7bf2d56b1057
( i changed the name files) i need use for route external devices.
Sorry i'm very noob
The config local in local docker is ok
neos
March 30, 2020, 10:32am
6
this is my docker-compose of traefik
version: '3'
services:
traefik:
image: traefik:v2.1.8
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data/traefik.yml:/traefik.yml:ro
- ./data/acme.json:/acme.json
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`domain.domain.com`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=traf:$$apq$$qKGYqAok8RWK.Vlb26IfC0"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`domain.domain.com`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true
ldez
March 30, 2020, 10:34am
7
Your file is not mounted.
version: '3'
services:
traefik:
image: traefik:v2.1.8
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data/traefik.yml:/traefik.yml:ro
- ./data/acme.json:/acme.json
- ./data/dyn-config.yml/etc/traefik/dyn-config.yml # <--------------
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`domain.domain.com`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=traf:$$apq$$qKGYqAok8RWK.Vlb26IfC0"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`domain.domain.com`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true
neos
March 30, 2020, 11:04am
8
i add:
- ./data/dyn-config.yml:/etc/traefik/dyn-config.yml
Cannot start the provider *file.Provider: error reading configuration file: /etc/traefik/dyn-config.yml - read /etc/traefik/dyn-config.yml: is a directory"
neos
March 30, 2020, 11:21am
9
sorry is solved i created "directory" not file
Very thx by your help