a month ago
Hi,
I have a service called eigeniv-backend in my project, staging environment.
The default Railway URL works perfectly:
https://eigeniv-backend-staging.up.railway.app/health returns a healthy response every time.
But my custom domain does not work:
https://api-staging.eigeniv.com/health returns a 502 error, "Application failed to respond," every single time.
Both are supposed to point to the exact same service.
I have already checked:
- DNS is correctly set up (CNAME pointing to eigeniv-backend-staging.up.railway.app)
- DNS has fully propagated worldwide, confirmed with a DNS checker tool
- The domain ownership verification record is also fully propagated
- The port is set correctly (3000) in the custom domain settings
- I have removed and re-added the custom domain twice, waiting several minutes each time, with no change
Since the same service works fine on Railway's own URL but not on my custom domain, I believe there may be a routing issue on Railway's side connecting this domain to my service.
This project was deleted and recreated once during initial setup, so there may be a leftover/stale configuration from that.
Could you please check why api-staging.eigeniv.com isn't routing to my service correctly?
Thank you.
1 Replies
a month ago
Your custom domain's target port is set to 3000, but your Railway service domain targets port 8080, which is where your application is actually listening. The 502 occurs because the edge sends custom-domain traffic to port 3000 and nothing answers there. Update the custom domain's target port to 8080 in the service's domain settings and the 502 will resolve.
Status changed to Awaiting User Response Railway • 26 days ago
Status changed to Solved lovekeshpal • 26 days ago