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'

  • 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

502 errors with Cloudflare proxy and custom domain - Railway Help Station