22 days ago
I am experiencing a persistent 502 Bad Gateway
error on all preflight OPTIONS
requests to my Node.js/Express service, which is preventing my front-end application from functioning.
Evidence:
My service is stable and healthy. The deployment logs confirm that the application starts successfully, connects to the database, and responds to the
/health
check path as expected.Deployment Log:
[INFO] Application starting... [INFO] Database pool created successfully. [INFO] Server is running on http://0.0.0.0:8080
The error only occurs on preflight
OPTIONS
requests from the browser. The attached HTTP log shows theOPTIONS
request to/auth/login
failing with a502
status after a 10-second timeout.HTTP Log Snippet:
method: "OPTIONS" path: "/auth/login" httpStatus: 502 totalDuration: 10575
The request never reaches my application. My application code includes detailed logging for all incoming requests, and the
OPTIONS
request from the browser never appears in the deployment logs.
This evidence strongly indicates that the issue is with the Railway proxy/gateway layer, which is not correctly forwarding these specific preflight requests to my running container.
Why is the proxy is returning a 502
error for these requests instead of routing them to my healthy service?
2 Replies
22 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!
22 days ago
Hello,
Even a simple GET request to the root of the application is returning a 502, so this is not isolated to preflight options requests.
Traffic is not being forwarded to your application because you have the target port set incorrectly, please see our docs on that topic -
Best,
Brody
Status changed to Awaiting User Response Railway โข 22 days ago