Deployment Architecture
Traefik uses Anubis as a ForwardAuth middleware:Docker Compose Configuration
Here’s a complete working example with Traefik v3.3: compose.yml:How It Works
- User requests
https://example.com - Traefik checks middleware - ForwardAuth sends request to
http://anubis:8080/.within.website/x/cmd/anubis/api/check - Anubis validates:
- If validated: Returns 200, Traefik forwards to backend
- If not validated: Returns 401 with redirect to challenge page
- User completes challenge at
https://anubis.example.com - Anubis redirects back to
https://example.com - Request succeeds - cookie is set, future requests pass validation
ForwardAuth Middleware
The key configuration is the ForwardAuth middleware:Additional ForwardAuth Options
Multiple Protected Services
Protect different services with the same Anubis instance:Path-Based Protection
Protect only specific paths:Kubernetes Deployment
For Kubernetes with Traefik ingress controller, see the Kubernetes deployment guide. Quick example using Ingress:Custom Middleware Chain
Combine Anubis with other Traefik middlewares:Health Checks
Configure Traefik to health check Anubis:Load Balancing Multiple Anubis Instances
Troubleshooting
Redirect Loops
Check:REDIRECT_DOMAINSincludes all your domainsPUBLIC_URLmatches Anubis router hostnameCOOKIE_DOMAINis set correctly
502 Bad Gateway on Auth Request
Verify:- Anubis is running:
docker ps - Network connectivity:
docker exec traefik wget -O- http://anubis:8080/.within.website/x/cmd/anubis/api/check - Check Traefik logs:
docker logs traefik
Certificates Not Working
Ensure:- DNS points to your server
- Ports 80 and 443 are accessible
- Email is configured in traefik.yml
- Check Let’s Encrypt rate limits
ForwardAuth Not Triggering
Verify:- Middleware is attached to router:
middlewares=anubis@docker - Middleware name matches:
traefik.http.middlewares.anubis.forwardauth.address=... - Check Traefik dashboard for middleware configuration