Infinite reload when deplyong NextJS to dedicated server #2749
Replies: 2 comments 2 replies
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a following problem. I am developing an application using NextJS and Clerk. On development the auth flow is working fine. I click sign in, get redirected to
/sign-in
and so on...In order to have a staging environment I usually deploy those apps to my dedicated ubuntu server using docker and proxy different subdomains to the correct docker container. (In the further details the domain is further referenced as
sub.domain.de
which should serve the nextjs app. SSL and DNS records for the subdomain are all set up)Now when I visit the page everything is working fine. I click sign in, it redirects me to
/sign-in#
(not the # for some reason) and I end up in an infinite refresh loop. I can manually remove the # from the url and I then see the login form. After login I get back to my homepage and have an endless refresh loop again. Hard reloading the page fixes it.All the env variables are set up:
My nginx config looks something like this:
Those are clerk's debug logs:
For some reason the
nextUrl
andurl
are referring to localhost while theclerkUrl
refers to my domain. Is this maybe causing the issue? How can I avoid this?I am not sure if this is a configuration issue or an issue within the package. Maybe someone has experience with it and can help me out here.
I also studied this issue but it could not resolve my problem.
Any help is appreciated
Beta Was this translation helpful? Give feedback.
All reactions