Forward auth
defguard supports forward auth integration with popular reverse proxies (tested with traefik and caddy). This allows you to use defguard to secure services which don't provide their own authorization or OAuth integration.
In order for forward auth to work the services you are trying to protect must be available at URLs within the same base domain as your defguard instance.
For example if you are serving your defguard UI at id.yourdomain.com
, then your services must use other subdomains of yourdomain.com
, e.g. app1.yourdomain.com, `service.yourdomain.com` etc
.
Additionally you have to update your defguard config to set the cookies domain to yourdomain.com
.
Example configurations
For brevity all of the examples below assume you are hosting your defguard instance at defguard.yourdomain.com
.
We'll use a basic whoami container as an example service which will be available at whoami.yourdomain.com
.
Traefik
docker-compose.yml
Caddy
Caddyfile
docker-compose.yml
Last updated