You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Traefik forwardauth middleware and different domains #1985
Is your feature request related to a problem? Please describe.
I have multiple sites hosted under distinct root domains (e.g. domain1.org, domain2.org, domain3.org), some of which I want to protect with Anubis. I am using Traefik as the reverse proxy. The setup that I have found working is to have the routes that I want to protect go to Anubis first which then proxies them back to Traefik through a separate entrypoint to be routed to the actual backend services (e.g. WordPress container).
However, this seems clunky and unnecessary, and may result in skewed metrics. It would be nicer to be able to use the forwardauth middleware like in the recommended Traefik setup. But this fails, because it requires Anubis to be hosted under one specific root domain (e.g. anubis.domain1.org) meaning its cookies won't be available to subsequent requests to e.g. domain2.org, leading to a redirect loop.
Solution you would like.
I can think of two possible solutions:
Keep serving Anubis from a single domain, but add a validation token (e.g. in the query string) when redirecting back to the other domain, which then results in the request being validated and setting the cookies correctly (this might require Add forwardAuth.addAuthCookiesToResponseRegex traefik/traefik#12229 to be merged by Traefik).
Serve Anubis under a path prefix of each domain. This would require the public url to be dynamically constructed based on the Host of the request, instead of having to provide it as a static environment variable.
Describe alternatives you have considered.
No response
Additional context
No response
Reacted by Matthias Dötsch, Muhammad Oktoluqman Fakhrianto and deafening832
Activity