custom domain important
hasanmuradi
PROOP

2 months ago

Hi,

I am trying to connect a custom domain to my Railway frontend service (HTML/CSS/JS static site).

My setup:

  • Frontend deployed on Railway
  • Custom domain: itlearningbh.com
  • DNS managed via Cloudflare
  • CNAME records correctly pointing to Railway domain
  • Both root and www domains are configured

However, I am facing issues:

  1. The domain sometimes returns "502 Bad Gateway"
  2. Sometimes I get "Application failed to respond"
  3. SSL certificate issues appear for www subdomain (ERR_CERT_COMMON_NAME_INVALID)
  4. I have already set Cloudflare DNS to "DNS only" (not proxied)
  5. My app runs a static server using serve and listens on process.env.PORT

I have verified:

  • DNS records are correct
  • Railway deployment is active
  • Application runs successfully on Railway default domain

But the custom domain is not stable and does not properly resolve.

Could you please help me verify the correct setup for:

  • Custom domain configuration on Railway for a static frontend
  • Proper handling of www + root domain
  • SSL certificate provisioning for custom domain

Thank you.

Closed

4 Replies

2 months ago

Re 502, as you see this only sometimes, do you have serverless enabled?


2 months ago

And could you list the domain(s) affected?


2 months ago

oops sorry


2 months ago

Your service itself, is seemingly failing to respond?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...