nextjs-request-url-proxy-redirect
Fix for NextResponse.redirect going to wrong host (localhost:8080) on Railway, Vercel, or containerized deployments. Use when: (1) redirects work locally but go to localhost in production, (2) console shows ERR_CONNECTION_REFUSED to localhost:8080 or similar internal URL, (3) using `new URL(path, request.url)` for redirects in Next.js API routes or middleware. The fix is to use NEXT_PUBLIC_APP_URL environment variable instead of request.url as the base URL.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Fonctions et usage
Fix for NextResponse.redirect going to wrong host (localhost:8080) on Railway, Vercel, or containerized deployments. Use when: (1) redirects work locally but go to localhost in production, (2) console shows ERR_CONNECTION_REFUSED to localhost:8080 or similar internal URL, (3) using `new URL(path, request.url)` for redirects in Next.js API routes or middleware. The fix is to use NEXT_PUBLIC_APP_URL environment variable instead of request.url as the base URL.
Démarrage rapide
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Guides ↗Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-24
- Mise à jour de l’index
- 2026-01-24
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!