Custom domains stuck returning 502 at the edge (default *.up.railway.app domain works fine)
brunoandradeportela-design
FREEOP

18 days ago

Project: courageous-endurance, service "simulador-tributario" (production).

Project ID: 15afc787-dc3c-4d10-929a-53b4ed5a9302

Service ID: 6490ff54-1ac4-4022-8eb4-466f6b8ee9d6

Environment ID: 979e30b4-4299-4dfc-af79-6bd1f6c6704b

Issue: any custom domain attached to this service returns 502 "Application failed to respond" at the edge, in a few milliseconds, without ever reaching the app (confirmed via HTTP logs - zero corresponding request on the app side). The default *.up.railway.app domain works perfectly and returns 200 for the same paths.

Timeline:

  1. Original custom domain www.tributasim.com.br (CNAME -> h27szh4j.up.railway.app). Showed fully verified (green check, no "waiting for DNS") but returned 502 for 5+ hours straight.
  2. Deleted and re-added the domain to force reprovisioning. Railway generated a new CNAME target (x3j76pap.up.railway.app). Updated DNS accordingly and confirmed propagation via public DNS resolvers. Domain showed verified again, still 502.
  3. To isolate whether it was specific to the "www" hostname, deleted that domain and added a brand new one on a different subdomain: app.tributasim.com.br (CNAME -> 9uxtakhp.up.railway.app, port 3000). DNS propagated correctly (verified via dns.google). Railway shows it verified too. Still 502, same millisecond-fast failure pattern, no app-side logs.

So this isn't DNS (propagation confirmed both times via public resolvers), isn't the app (default domain is healthy), and isn't specific to one hostname (reproduced with two different custom domains). Looks like a stuck/broken edge routing binding for custom domains on this specific service.

status.railway.com shows "Fully Operational" with no incidents, but I noticed several other threads posted here in just the last hour with similar symptoms (edge routing 404s/502s on correctly running deployments, across different services) - might be a broader edge issue not yet reflected on the status page.

Would appreciate help checking the edge routing/cert binding for this service's custom domains. Happy to share more logs/screenshots.

Solved

1 Replies

Railway
BOT

18 days ago

The edge HTTP logs for your custom domain show "connection refused" on every attempt, which confirms a target-port mismatch. Your .up.railway.app domain uses auto-detect and reaches the app on whatever port it actually binds, but your custom domain has its target port explicitly set to 3000 and the app is not listening there. To fix this, open the custom domain's settings on your service and either clear the explicit port so it auto-detects (matching your working default domain) or set it to the port your app actually listens on.


Status changed to Awaiting User Response Railway • 18 days ago


Railway
BOT

11 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 11 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...