traefik

Is there a way to add basic auth to docker compose with labes for traefik?
...
labels:
- traefik.enable=true
- traefik.http.routers.next-app.rule=Host(`next-app.dokploy.com`)
- traefik.http.routers.next-app.entrypoints=websecure
- traefik.http.routers.next-app.tls.certResolver=letsencrypt
- traefik.http.services.next-app.loadbalancer.server.port=3000
...
...
labels:
- traefik.enable=true
- traefik.http.routers.next-app.rule=Host(`next-app.dokploy.com`)
- traefik.http.routers.next-app.entrypoints=websecure
- traefik.http.routers.next-app.tls.certResolver=letsencrypt
- traefik.http.services.next-app.loadbalancer.server.port=3000
...
2 Replies
Siumauricio
Siumauricio5mo ago
Traefik BasicAuth Documentation - Traefik
The HTTP basic authentication (BasicAuth) middleware in Traefik Proxy restricts access to your Services to known users. Read the technical documentation.
Pablopvsky
PablopvskyOP5mo ago
I take the Wordpress template, add the labels + basic auth label and do not work. Is there something that I'm missing?

Did you find this page helpful?