502 Bad Gateway on root domain and www — app subdomain works fine (Cloudflare + Railway)
md18358
PROOP

2 months ago

fireinspecthub.com and www.fireinspecthub.com returning 502 Bad Gateway for 13+ hours. app.fireinspecthub.com works fine on the same service.

Service ID: b2a39cdb-360d-47de-a728-f2daea983f4e

Project ID: 366c9df5-2086-40fc-bbd0-4c659c01593f

All three domains on same Railway service. All show Cloudflare proxy detected. Gunicorn starts clean — no errors in deployment logs. DNS is Cloudflare authoritative.

Working: app.fireinspecthub.com → f6gqii9t.up.railway.app

Broken: fireinspecthub.com → 0hp2tua8.up.railway.app

Broken: www.fireinspecthub.com → llsglpe1.up.railway.app

Issue started around the time of CDN changelog #0283 on March 27. Suspect new CDN routing is not handling root domain and www correctly.

16 Replies

Can you screenshot the custom domain configuration on Railway, and the requested DNS values?


md18358
PROOP

2 months ago

fireinspecthub.com

0hp2tua8.up.railway.app

railway-verify=bacfcc3adba4500105e1ba035b2d817b94c2e2ee008d65a7e730349b8f63c86b

www.fireinspecthub.com

1lsglpe1.up.railway.app

railway-verify=7d9ed75e9b44c54c605adadb5f2fe753a7f89668f03b0cf90e34cfbd826f7c67

image.png

image.png

image.png


Can you try changing the target port of [www.]fireinspecthub.com to 3000?


leave app.fireinspecthub.com as is


md18358
PROOP

2 months ago

Ok, changing now


md18358
PROOP

2 months ago

no joy. i tried in incognito mode as well.


do you know what port the landing page (root and www) listens on?


md18358
PROOP

2 months ago

The app runs on Gunicorn and listens on $PORT which Railway sets automatically. The start command is:

python manage.py migrate && python manage.py collectstatic --noinput && gunicorn dispatcher_core.wsgi --bind 0.0.0.0:$PORT

The deployment logs show it started on port 8080. app.fireinspecthub.com works correctly on port 8000 in Railway settings


Cloudflare is masking Railway's error page

Hard to diagnose like that, perhaps temporarily disable Cloudflare proxied to see the actual error?


I still believe it may be a port mismatch


md18358
PROOP

2 months ago

ok i will proceed to disable cloudflare


md18358
PROOP

2 months ago

Disabled Cloudflare proxy on both domains. Now seeing Railway's own error page: 'Application failed to respond'

Request ID: aWs8ZsNDShOXDU6Jc9o55Q

This confirms it's a Railway routing issue not Cloudflare. The request is reaching Railway but Railway is not routing it to the application correctly.


This confirms that it's a port issue


3000 may not be correct, but 8000 isn't either


(this is not a Railway issue, just a configuration error)


md18358
PROOP

2 months ago

ok, Port 8080 fixed it. Both fireinspecthub.com and www.fireinspecthub.com are now working. Thank you!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...