NextAuth behind nginx https proxy doesn't get session
I have got my app working in development and now wanted to move everything to production. My Database, Next.js and NGINX all run in docker containers. To create a secure connection I configured nginx to handle SSL and redirect everything to https. Now I'm facing the following problem: - When I sign in without the proxy enabled on an http connection everything works fine - When I turn on the proxy: - The "Sign in with discord" button redirects me to the same site again but with ?csrf=true at the end - Clicking it again now redirects to discord correctly - After logging in a session is created in the database but calling session.user returns null
I don't get what part fo the authentication fails here. can someone give some advice please