3 months ago
I’m running a project on Railway with three services: Next.js, NestJS, and Nginx.
I’m facing an issue where I cannot reach my Next.js server from other services using the internal URL. If I use the public URL, everything works fine, but internal connections fail.
When I try to reach Next.js from Nginx, I get a 502 Gateway Error.
I tested my Nginx configuration and it looks correct.
When I
curlfrom inside another container, the request succeeds with the public domain, but fails with the internal hostname/URL.
I’m using the official Next.js Docker template from Vercel:
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
It seems like the Next.js container isn’t accessible internally, only externally through Railway’s public proxy.
1 Replies
3 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 SIGTERM ISSUE: Code is fine but unable to access public url of my node server
🧵 Next.js private network communication issue with .NET API services
🧵 Next.js App Access Issue - App ID ebee6730-760d-43e2-ae2a-9b3900744448
If you find the answer from one of these, please let us know by solving the thread!
Status changed to Solved pbird • 3 months ago