3 months ago
Hi I have a frontend service connected to a custom domain and the deploy logs aren't showing any errors. But I keep getting 502 errors when trying to access the domain?
7 Replies
I assumed it was a lets encrypt issue since there was an outage yesterday but am still getting 502s even now with everything back up
Tried resetting domain per https://discord.com/channels/713503345364697088/1448112503027400754/1448112503027400754 but no luck
3 months ago
This is also not related to the Let's Encrypt outage. I am going to let the community help you debug this configuration or application-level issue.
3 months ago
first check if your railway domain itself works (like the frontend-production.up.railway.app one)if that works then it's definitely a custom domain ssl thing, if it doesn't then your app config is the problem
most common issue is the port binding. your app needs to listen on 0.0.0.0 not localhost, and it needs to use railway's PORT env variable. like this:
javascript
// this breaks everything
app.listen(3000, 'localhost');
// this actually works
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => {
console.log(`listening on 0.0.0.0:${port}`);
});check your deployment logs too ,you should see something like "server listening on 0.0.0.0:8080" or whatever port. if you see localhost or 127.0.0.1 that's your problem right there
3 months ago
Thanks for the steps, ended up actually being an application error (I was running the 'dev' command to start instead of my production static files).
