A Traefik custom plugin to redirect users based on the Authorization header in the incoming request.
Reference: the official documentation for developing Traefik custom plugins.
Set in the Dynamic config file (traefik-config/dynamic-config.yml
) the URLs on which you want to redirect an anonymous user (public
config)
and a logged one (public
private).
Execute
docker build --tag traefik-custom-router .
to build the Docker image.
Execute
docker run --rm -it -p 80:80 -p 8080:8080 --name traefik docker.io/library/traefik-custom-router
to see it in action.