502 Bad Gateway - Connection Closed Unexpectedly

marcus1688
PROOP

16 days ago

Hi on my application host i sometimes got 502 error, i tried change the port to 8080, added health check endpoint but still faced the same issues, on my application logs it show successful response, but railway http logs show 502 errors.

requestId:

"FhNvgG4jTIypRWnjxtoGcA"

timestamp:

"2025-10-23T21:16:36.561088908Z"

method:

"POST"

path:

"/api/pgslot2/applycreatebet"

host:

"api.jinlihui.net"

httpStatus:

502

upstreamProto:

""

downstreamProto:

"HTTP/2.0"

responseDetails:

""

totalDuration:

122

upstreamAddress:

""

clientUa:

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"

upstreamRqDuration:

122

txBytes:

109

rxBytes:

1033

srcIp:

"172.68.211.108"

edgeRegion:

"us-west2"

upstreamErrors:

"[{"deploymentInstanceID":"fceba594-3684-41d9-88b0-b986106d1afc","duration":122,"error":"connection closed unexpectedly"}]"

$10 Bounty

3 Replies

Railway
BOT

16 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


16 days ago

Hello,

Can you try setting your keepalive to 85 seconds?


Status changed to Awaiting User Response Railway 16 days ago


marcus1688
PROOP

13 days ago

by setting keep alive to 85 second meaning i just add the /health endpoint?


Status changed to Awaiting Railway Response Railway 13 days ago


502 Bad Gateway - Connection Closed Unexpectedly - Railway Help Station