Skip to content

Instantly share code, notes, and snippets.

@ideaengine007
Created May 22, 2024 22:23
Show Gist options
  • Select an option

  • Save ideaengine007/30bcb6ab8e4c0d35b9b30d1b3e505688 to your computer and use it in GitHub Desktop.

Select an option

Save ideaengine007/30bcb6ab8e4c0d35b9b30d1b3e505688 to your computer and use it in GitHub Desktop.
Docker Compose YAML for observing Traefik BasicAuth middleware with nginx container
services:
reverse-proxy:
image: traefik:v2.10
command: --providers.docker --entrypoints.web.address=:80
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
nginx:
image: nginx:latest
labels:
- "traefik.http.routers.nginx.entrypoints=web"
- "traefik.http.routers.nginx.rule=Host(`nswashere.local`)"
- "traefik.http.routers.nginx.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=test:$$2y$$12$$ci.4U63YX83CwkyUrjqxAucnmi2xXOIlEF6T/KdP9824f1Rf1iyNG" # credentials test:test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment