0

I have a problem with Traefik. All my services are OK, Traefik does his job, retrieves the certificates of Lets Encrypt, makes Load blancing between my different applications.

My problem is that I can't access the Dashboard, it asks me a login/password, yet I informed it in the docker-compose.

version: "3.7"
services:

  traefik:
     image: traefik:chevrotin
     command:
       --entrypoints.http.address=:80
       --entrypoints.https.address=:443
       --providers.docker=true
       --api=true
       --certificatesresolvers.letsencrypt.acme.httpchallenge=true
       --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http
       [email protected]
       --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
     labels:
       - traefik.enable=true
       # Redirect all HTTP traffic to HTTPS
       - traefik.http.routers.to-https.rule=Host(`traefik.mydomain.com`)
       - traefik.http.routers.to-https.entrypoints=http
       - traefik.http.routers.to-https.middlewares=to-https
       
       - traefik.http.routers.traefik.rule=Host(`traefik.mydomain.com`)
       - traefik.http.routers.traefik.entrypoints=http
       - traefik.http.routers.traefik.middlewares=auth
       - traefik.http.routers.traefik.service=api@internal
       - traefik.http.routers.traefik.tls=true
       - traefik.http.routers.traefik.tls.certresolver=letsencrypt
       
       - traefik.http.middlewares.to-https.redirectscheme.scheme=https
       
       - traefik.http.middlewares.auth.basicauth.users=MyLogin:MyPassword
     ports:
       - 80:80
       - 443:443
     volumes:
       - /var/run/docker.sock:/var/run/docker.sock:ro
       - /docker/letsencrypt:/letsencrypt

if you have a idea. Thanks

1 Answer 1

1

I find. I'm not encoded my password. I use this website : https://www.web2generators.com/apache-tools/htpasswd-generator to encoded my password.

  • "traefik.http.middlewares.test-auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj

Note: all dollar signs in the hash need to be doubled for escaping

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.