Loginhandler Error: Login handler failed. CAUSE: Discovery requests failing

Hey everyone,

when i try to login from my app i receive:
Loginhandler Error: Login handler failed. CAUSE: Discovery requests failing for https://dev-senbjf-test.eu.auth0.com.

Here is my setup:

I have this domain: www.domain.de. This domain points to a IIS Server with some legacy apps. I habe an additional Linux machine where i run my Docker apps with auth0 on. This Server is reached via www.domain.de/next. So Basically my Auth0 app is running on a subpath of my domain.

Since www.domain.de/next resulted in a 404 my Nginx (on the Linux host) needs to rewrite into www.domain.de/next/ with a trailing slash:

location = /next {
    return 301 $schema://$host$uri/;
}

location ^~ /next {
   rewrite ^/next(/.*)$ $1 break;
   proxy pass http://app_dashboard:3000;
  http version ...
  sever set_header...
}

i also set basePath and assettPrefix in Nextjs config.

the env variables are checked and passed on the docker run via --env-file. By inspecting the container i can confirm that the env variables are loaded.

now my machines are behind corporate firewalls and proxys. But i can confirm having a correct network setup because from the host and from within the container i can curl to any address including my tenent and receive a list of information with status 200. i also successfully testing the management api with the provided curl statement. So i guess it has to do with either nextjs config or the way auth0 handles a subpath.

Does anyone has any idea what could lead to this problem?

Best regards
Lars