Railway's ingress proxy is routing POST requests differently than GET requests.
Anonymous
HOBBYOP

2 months ago

My Node.js backend (scenefinder-backend, deployment 9eee43ba) registers POST /api/search and POST /api/upload — confirmed in startup logs. But all POST requests from external clients return {"error":"Route not found"}, which is our app's 404 catch-all handler. This means Railway's ingress proxy is routing POST requests differently than GET requests.

GET /api/library works fine (returns 200). But GET /api/search (a POST-only route) returns 404 instead of 405 Method Not Allowed. This proves the request is being intercepted before Express can check the HTTP method.

Please check if there is a routing rule, ingress config, WAF rule, or proxy layer that is blocking or stripping POST method traffic before it reaches port 8080.

Solved$10 Bounty

2 Replies

Status changed to Open Railway 2 months ago


Status changed to Awaiting User Response Railway 2 months ago


Since you're getting {"error":"Route not found"} , it means your express app is receiving the request, and returning your custom JSON payload. Plus, Express does not return 405s by default. When you send a GET request to a POST route, it just skips your POST route and moves to the next defined routes in your app (in this case, hitting your catch-all segment).

As for POST requests turning into GET requests, one possible scenario this could happen is if your client is using http instead of https, resulting in a redirect to https.

This is from the MDN docs:

Attachments


Status changed to Awaiting Railway Response Railway 2 months ago


Status changed to Awaiting User Response Railway 2 months ago


Sharing your express setup would be helpful in determining the real cause, if the previous reply didn't help.


Status changed to Awaiting Railway Response Railway 2 months ago


Status changed to Awaiting User Response Railway 2 months ago


Railway
BOT

2 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...