502 errors with Cloudflare proxy and custom domain
bhrugu-scientist
HOBBY
3 months ago
My Next.js application running on Railway is experiencing 502 Bad Gateway errors when accessed through Cloudflare.
Issue: Cloudflare returns '502 Bad Gateway' with error 'failed to forward request to upstream: connection refused'
My app works fine on the Railway-provided URL (noshu-production.up.railway.app)
I have set up CNAME records in Cloudflare.
My app is running on port 3000 with a custom domain (nosh.network)
Railway shows 'Cloudflare proxy detected' in domain settings
Could this be a configuration issue on Railway's side with handling Cloudflare proxied connections?
0 Replies