Running NextJS with Auth0 behind a Proxy

Hey folks,

i have a NextJS 14 app with Auth0 that runs perfectly on local. Now i deployed my app to a virtual Server of my company. The problem seems to be, that this server is behind a proxy. In order to run the Docker container with my app, i pass env variables like this:

docker run -d -p 8443:3000 -e HTTP_PROXY=“$HTTP_PROXY” -e HTTPS_PROXY=“$HTTPS_PROXY” -e NO_PROXY=“$NO_PROXY” --env-file /home/docker/config/auth0.env

i can validate that these variables are inside the container and from that container a curl -v to my auth0 domain /.well-known/openid-configuration works perfectly.

but if i run my app and click on login the urls moves to instead of the auth0 login page. The docker logs show the following message.

[LoginHandlerError]: Login handler failed. CAUSE: Discovery requests failing for

Is my assumption correct that this is because of the proxy? Also it seems that the docker env variables are not enough. do i need to adjust my nextJS code to handle the proxy?

Your help is very appreciated