NestJS redirect and subdomains
Unanswered
Belgian Hare posted this in #help-forum
Belgian HareOP
Hi guys, I got a question that might be silly or not but is regarding the NextJS redirect in v
*I’m using the redirect in a server action.
14.2.4. So I have a multi-tenant app, and in my middleware is where I rewrite my NextResponse. I'm using the tenant as a subdomain, so let's say that my local url looks like this: http://mytenant.localhost:3000/. So I have a case where I'm using redirect() from next-navigation to send the user to redirect('/the-redirect-url/foo/faa'). In the middleware when I want to grab that subdomain from the req.headers.get('host') I just got localhost as a host, while if I just reload a page from my subdomain, I do get mytenant.localhost as the host. So, what'm I doing wrong? Any hints or modifications? Did I miss something?*I’m using the redirect in a server action.