Traefik annotation for Anubis query #1411
-
|
Hi, Newb question: I'm trying to add Anubis to my Immich instance (for fun, and learning!) on a rootless Docker host with Traefik. When following the documentation, I add the annotation
If I remove the annotation it works, but obviously Anubis is bypassed. Adding the following annotation to the immich-server does allow it to work, but contradicts the documentation: ...I thought the 'forwardauth.address' should go under Traefik's labels, according to the instructions? Here is my compose file (sorry it's a bit long): Containers seem to be up and running: I tried following the guide but I've obviously made a mistake somewhere, or the documentation is wrong/out of date? Any advice here would be appreciated. I'd like to make sure I'm doing this correctly. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
the issue is that traefik cant find the middleware because its defined on a different container. when you define middleware labels on traefik container itself, it needs traefik.enable=true on that container too. try this - move the middleware definition to anubis container: anubis:
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.anubis.forwardauth.address=http://anubis:8080/.within.website/x/anubis/api/check"
- "traefik.http.middlewares.anubis.forwardauth.trustForwardHeader=true"the middleware gets registered from whatever container has traefik.enable=true. since traefik itself doesnt have that label, the middleware definition on it gets ignored. alternatively add traefik.enable=true to your traefik container labels and it should pick up the middleware. |
Beta Was this translation helpful? Give feedback.
the issue is that traefik cant find the middleware because its defined on a different container. when you define middleware labels on traefik container itself, it needs traefik.enable=true on that container too.
try this - move the middleware definition to anubis container:
the middleware gets registered from whatever container has traefik.enable=true. since traefik itself doesnt have that label, the middleware definition on it gets ignored.
alternatively a…