a year ago
The deploy does it correctly according to the logs, but when I try to access through the url provided by the railway container, it shows a 502 bad gateway error message and in the page an error saying that the application has failed to respond.
I do not understand what can be the problem.
Pinned Solution
a year ago
Make sure you have set the port in public network to 8080
Attachments
5 Replies
a year ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Getting 502 bad gateway error on first deploy
- 🧵 Vite Deploy 502
- 🧵 502 bad gateway
- 🧵 502 Bad Gateway error despite successful container startup
If you find the answer from one of these, please let us know by solving the thread!
a year ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 11 months ago
a year ago
Check your app is listening on the correct port
Railway expects your app to listen on:
PORT=8080
Make sure your server code uses:
app.listen(process.env.PORT || 8080);
a year ago
my script in package.json it is
"start": "serve dist -s -n -L -p 8080"because I use
"serve": "^14.2.4"for up my app
a year ago
Make sure you have set the port in public network to 8080
Attachments
phoenixauro
Make sure you have set the port in public network to 8080 
a year ago
Excellent, this worked. I hadn't realized that it was pointing to another port. Best regards and thank you.
Status changed to Solved brody • 11 months ago
