req.nextUrl.origin resolves to localhost inside the container. Using req.url preserves the Host header the browser sent, so redirects work when accessing via IP or any external hostname. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
req.nextUrl.origin resolves to localhost inside the container. Using req.url preserves the Host header the browser sent, so redirects work when accessing via IP or any external hostname. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>