#1985·anubis

Traefik forwardauth middleware and different domains

Author: yanusCreated Sep 29, 2026Updated Sep 29, 2026

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:

  1. 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 https://github.com/traefik/traefik/pull/12229 to be merged by Traefik).
  2. 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