I got these errors when I try to start traefik for the first time :
traefik | 2024-07-03T20:32:27+02:00 ERR error="accept tcp [::]:443: use of closed network connection" entryPointName=https
traefik | 2024-07-03T20:32:27+02:00 ERR error="accept tcp [::]:80: use of closed network connection" entryPointName=http
traefik | 2024-07-03T20:32:27+02:00 ERR error="close tcp [::]:80: use of closed network connection" entryPointName=http
I opened the ports on my router (Unifi Network) and when using public ip + 80 or 443 on a port checker website it says the ports are open.
Here is what my docker-compose.yml
file looks like :
version: "3.5"
services:
traefik:
image: traefik
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- external_proxy
ports:
- 800:80
- 4443:443
- 8060:8080
environment:
- CF_API_EMAIL=***
- CF_DNS_API_TOKEN=***
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /volume2/docker/appdata/traefik/traefik.yml:/traefik.yml:ro
- /volume2/docker/appdata/traefik/acme.json:/acme.json
- /volume2/docker/appdata/traefik/config.yml:/config.yml:ro
- /volume2/docker/appdata/traefik/logs:/var/log/traefik
labels:
- traefik.enable=true
- traefik.http.routers.traefik.entrypoints=http
- traefik.http.routers.traefik.rule=Host(`traefik-dashboard.mydomain.com`)
- traefik.http.middlewares.traefik-auth.basicauth.users=*****
- traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.sslheader.headers.customrequestheaders.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(`traefik-dashboard.mydomain.com`)
- traefik.http.routers.traefik-secure.middlewares=traefik-auth
- traefik.http.routers.traefik-secure.tls=true
- traefik.http.routers.traefik-secure.tls.certresolver=cloudflare
- traefik.http.routers.traefik-secure.tls.domains[0].main=mydomain.com
- traefik.http.routers.traefik-secure.tls.domains[0].sans=*.mydomain.com
- traefik.http.routers.traefik-secure.service=api@internal
networks:
external_proxy:
external: true
I have this in traefik.yml
:
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
network: external_proxy
file:
filename: /config.yml
certificatesResolvers:
cloudflare:
acme:
email: ****@gmail.com
storage: acme.json
dnsChallenge:
provider: cloudflare
#disablePropagationCheck: true # uncomment this if you have issues pulling certificates through cloudflare, By setting this flag to true disables the need to wait for the propagation of the TXT record to all authoritative name servers.
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
I have an empty config.yml
file
I have an empty logs
folder
I have created empty acme.json
file (which got populated with my cloudflare info when i started the container)
Any idea what would be the issue?