The following snippet:
export async function POST(request: NextRequest) {
const requestUrl = new URL(request.url);
return NextResponse.redirect(
`${requestUrl.origin}/something`,
{
status: 301,
},
);
redirects to mydomain.com/something on vercel (which is the expected outcome).
But on other plattforms such as fly.io redirects to localhost:3000/something
What am I missing? Is there a missing config or env var that vercel is injecting by default with the domain value?
Is this documented somewhere?