Xmahbub
Xmahbub
RRailway
Created by Xmahbub on 4/9/2024 in #✋|help
Troubleshooting Host Retrieval Issues in Next.js Server-Side Middleware
I have configured a wildcard domain for railway.app and deployed a Next.js application. However, when checking the host from the server-side middleware using "const host = req.headers.get('host')", I'm receiving [::1]:39107 as the host instead of the original server subdomain.domain.com host. I have also attempted to retrieve the host using "req.headers.get('x-forwarded-host')", but it returns null. How can I obtain the request origin subdomain from my server-side?
13 replies