Next.js Discord

Discord Forum

Is there a way to change the host and port of the dev webpack-HMR WebSocket?

Unanswered
Chinese Alligator posted this in #help-forum
Open in Discord
Chinese AlligatorOP
We are rebuilding parts of our existing website using Next.js.
Assume,
Site A (our existing site) runs on port 8000
Site B (the new Next.js app) runs on port 8008

Both are running in Docker.
In development, users access /example on Site A, and Nginx rewrites that request to Site B’s /example. This setup worked perfectly until we upgraded Next.js to 16.0.3 (latest as of now).
After the upgrade, hot reload stopped working.

The dev WebSocket tries to connect to Site A’s host, not Site B’s host (screenshot attached). Because of that:
HMR fails
The Next.js dev overlay/indicator also doesn’t appear

Is there any way to manually configure the host/port used for the HMR WebSocket?
If you need additional details about our setup, I’m happy to provide them.

Thank you!

0 Replies