Error 502 on custom domain

nvtiPRO

7 months ago

I have a website hosted on Railway, and I've added a custom domain for my website using Cloudflare as my DNS provider. Everything is working fine with my website using the custom domain, but sometimes (like right now), it fails to load with the custom domain, showing an error 502. However, the default domain provided by Railway still works without any issues.

I restarted my service, but the error has not disappeared.

Awaiting User Response

11 Replies

7 months ago

https://iguide.ai/en -> Works

https://website-production-7903.up.railway.app/en -> Works

https://www.iguide.ai/en -> Doesn't work

So can you show me your DNS configuration?


Status changed to Awaiting User Response railway[bot] 7 months ago


nvtiPRO

7 months ago

@brody, I moved my main domain iguide.ai to another provider to prevent website downtime.

the subdomain www.iguide.ai is still route to railway (and doesn't work)

This is my DNS for www.iguide.ai: CNAME www 39fd8gdq.up.railway.app (attached image bellow)

To clarify, the custom domain was working when I set it up and worked well for about 1 day, but then it stopped working (railway domain is still work). I have faced this issue 3-4 times.

Attachments


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

Seems like you may have something misconfigured in Cloudflare, you can use the Ray ID to look into it with them further.


Status changed to Awaiting User Response railway[bot] 7 months ago


nvtiPRO

7 months ago

I don't think so because it worked when I finished setting up the domain. After about 1 day, it disappeared without any reconfiguration in Cloudflare.

I try to restart the service, but everything remains the same. The service only works again after I rebuild it. I tested because I faced with it many time.

I think this is a problem with the railway gateway.


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

Since the Railway provided domain works there would be no issues with our Proxy, this indicates that there is a misconfiguration either in Cloudflare or how your app is responding to the requests from Cloudflare.


Status changed to Awaiting User Response railway[bot] 7 months ago


nvtiPRO

7 months ago

I don't think so because it worked when I finished setting up the domain. After about 1 day, it disappeared without any reconfiguration in Cloudflare.

I try to restart the service, but everything remains the same. The service only works again after I rebuild it. I tested because I faced with it many time.

I think this is a problem with the railway gateway.

so can you explain why this happen? my website on www.iguide.ai is down right now, can you debug it? If you want any more information from my Cloudflare config, I can check for you.

My only option now is move from railway


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

Perhaps you could disable the Cloudflare Proxy on that domain for now?

If it starts working its a clear indication that the issue is your Cloudflare setup.


Status changed to Awaiting User Response railway[bot] 7 months ago


nvtiPRO

7 months ago

It working now without any setup in Cloudflare. I have to wait ultil it down again to test.


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

I'm not sure what you mean? www.iguide.ai is still proxied via Cloudflare -- I still see the Cloudflare error page.


Status changed to Awaiting User Response railway[bot] 7 months ago


nvtiPRO

7 months ago

@brody. I checked again and verify that the issue is related with Cloudflare Proxy option in DNS setup.

If I turn on Cloudflare Proxy option, the website gone with error 502. On railway dashboard, in custom domain setting, it show Cloudflare detected and a green cloud icon (not a green check mark)
If I turn off Cloudflare Proxy option, everything is ok

Can you explain that? Did I miss a setting somewhere?


Status changed to Awaiting Railway Response railway[bot] 7 months ago


7 months ago

I really wish I could help you with the Cloudflare side of things but we aren't able to provide support for 3rd party platforms, besides, Cloudflare's support would be able to guide you far better than I ever could.


Status changed to Awaiting User Response railway[bot] 7 months ago