Header values being stripped in one of the environment (staging) from Caddy
prmeh
PROOP

a month ago

We have Caddy deployed in all our environments which redirects requests to respective services.

Around 4th June we are facing an issue in one of our staging environment (environmentId=c0ab66ac-ae23-4d91-88d4-1c1d1604a29b) where request going to Caddy is removing headers value from request and forwarding to our Java backend service (service = 608d634a-a03c-4785-b6ca-94f45f5e46ec) causing issues.

The headers in question being passed are

api_key and requestedBy

When the request is being send using. the caddy domain names reportedly

https://caddy-staging.up.railway.app and https://api-test.uturn-system.com

the headers are being removed but if we make direct calls to Java backend services

https://backend-portal-staging.up.railway.app then request goes through and works fine.

Error logs when request goes through Caddy domains

"DefaultHandlerExceptionResolver - Resolved [org.springframework.web.bind.MissingRequestHeaderException: Required request header 'api_key' for method parameter type String is not present]"

POSTMAN error response

{

"timestamp": "Jun 11, 2026, 11:41:18 AM",

"status": 400,

"error": "Bad Request",

"path": "/portal/shippers/invoiceLines/{{shipmentNr}}"

}

This is happening only in this environment and not others. Can you please help us look into this issue and let us know if you need anything else from our end.

Solved

2 Replies

Status changed to Awaiting Railway Response Railway 26 days ago


a month ago

We don't modify or strip custom request headers at our edge, including underscore-named headers like api_key. Since requests sent directly to your backend domain succeed and only requests routed through your Caddy service fail, on both the Railway domain and the custom domain, the header is being dropped in your Caddy proxy layer rather than by us. That also explains why it is isolated to the single environment whose Caddy service was deployed separately from the others.


Status changed to Awaiting User Response Railway 26 days ago


prmeh
PROOP

22 days ago

Ok thanks for looking into it .. will resolve the issue as we found the issue on our side.


Status changed to Awaiting Railway Response Railway 22 days ago


Status changed to Solved Railway 22 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...