Custom Domain 502 Bad Gateway - Port Mismatch Issue
karasli-git
HOBBYOP

4 days ago

Description:

Problem:

When custom domain is added, it returns 502 Bad Gateway.

Railway domain works perfectly but custom domain fails.

This happens consistently - not a temporary issue.

Steps to Reproduce:

  1. Add custom domain api.diacorahealth.com:8080
  2. Try to access https://api.diacorahealth.com/health
  3. Get 502 error

Expected:

Custom domain should work like Railway domain.

Actual:

502 Bad Gateway error every time.

$10 Bounty

3 Replies

Railway
BOT

4 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 4 days ago


Try to set PORT=8080 in your service variables, and make your app listen on it, instead of hardcoding it.


darseen

Try to set `PORT=8080` in your service variables, and make your app listen on it, instead of hardcoding it.

karasli-git
HOBBYOP

4 days ago

olmadı


karasli-git

olmadı

Can you provide a screenshot of your domain's target port, and the port your app is listening on?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...