We had built a feature in our app that used the host header to change the branding to match. Aka, one app serving to multiple host names.
Recently this has stopped working. We used to get something like example.com as the content of the host header, but now it will be something like 0.0.0.0:46093 which has broken the feature.
Is there a workaround for this, cause it’s quite annoying to not be able to get the host from the host header.
Here is the network config for the app for reference:
Have tried practically every different way of getting the host header or hostname out of NextJS, in the middleware and in the pageInitialProps call. Locally everything is fine, running on fly I get nothing but 0.0.0.0.
I’ve been able to resolve the issue by some combination of changing from an alpine based docker image to the Debian based one suggested by Fly, removing the output: standalone option from my next.config.js, and using the built in Next server rather than a custom server.js.
That last one probably has the most to do with it.
Hope that info helps anyone else who comes across this issues.