Traefik Error page forwards to container instead of service

I have been using a combination of Organizr and ForwardAuth to handle my authentication.
Now for this to work I have an error page within Organizr that handles all 401 errors

This is part of a static "file" config containing:

  [HTTP.Middlewares.401.Errors]
          Status = ["401"]
          Service = "organizr-error@docker"
          Query = "/error.html"

In my stack on the organizr container this looks like:

      labels:
        traefik.enable: "true"
        traefik.http.services.organizr-error.loadbalancer.server.port: "80"
        traefik.http.services.organizr-error.loadbalancer.PassHostHeader: "true"

And on other services I use:


        traefik.http.routers.service-ext.middlewares: "401@file"

Now here is the problem.
The end-user browser gets redirected to https://organizr/
But of course, this is an unknown address as it's an internal (docker container) address
The error page isn't shown.

I can see that the forward authentication is working properly, I can see request coming into the authentication provider, and I can see it sends a response 401 "not authorized" back
I can also manually go to the error.html page and it returns the correct page

I have tested with latest table, and with latest RC

Am I missing something?

Does anyone have an idea on this? still haven't managed to find a solution to this

Still no idea, I have tried about anything I can imagine.. can't get this to work any way..

A year on and I still have no idea how to do this..
I use organizr as my authentication backend.
If a user is not logged in or his account doesn't have permission to access a page, traefik throws an error
I have an error handler setup in traefik which should react to 401-403 errors.
The error page is setup to forward to a page inside the organizr container
As such the organizr container is used for authentication, and for error handling
This way an unauthenticated user gets forwarded to the place they need to authenticate to..

The problem is that it provides the user with the unresolvable address: https://organizr/
Instead of: https://organizr.mydomain.com

Anyone who is able to help with this?

Hi @giblet

Should you be looking at https://docs.traefik.io/middlewares/forwardauth/ ?

Hey Cakiwi,

I went through the docs numerous times.
I can't seem to find where I'm going wrong.