Passing/forwarding X_PASSWORD header from client to mongrel

Hey all,

I’ve run into a problem with my beloved nginx. I’m putting together a
back-office payment gateway, which serves requests RESTfully to
ActiveResource on various front-end applications. Each ActiveResource
request passes X_PASSWORD on its header, which then gets used in the
payment gateway logic. The problem, though, is that nginx messes with
this header and no matter what I tried, I could not get it to work.
Here’s the line from my current nginx.conf:

proxy_set_header X_PASSWORD $http_x_password;

I’ve also tried

proxy_pass_request_headers on;
proxy_pass_header X_PASSWORD;
proxy_set_header HTTP_X_PASSWORD $http_x_password;

which do not work either. Just to make sure, I have tried by-passing
nginx and put mongrel directly on port http 80 (I’m using SSL 443 with
nginx) and everything worked just fine.

I did a literature search on google and while there are some similar
scenarios, I don’t think anyone has ever run into this problem directly.

I would appreciate any feedback, insight and help.

Best,
OA

OK. Problem solved. Here’s the deal:

If rails sets the header as ‘X_PASSWORD’, then nginx does not see this
value in $http_x_password. If rails sets it as ‘X-Password’ then nginx
does - problem solved.

Cheers,
OA