Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lost custom http header when using nginx+passenger

I'm trying to add some custom http headers for the authentication from mobile client, like

{'MOBILE_KEY' => 'xxx', 'MOBILE_SIGNATURE' => 'yyy'}

when I work with webrick/thin/mongrel in development, it works fine, but when I deployed it to the production server with nginx+passenger, the custom headers are removed, why? and what can I do?

like image 493
Richard Huang Avatar asked Dec 12 '22 13:12

Richard Huang


1 Answers

There is a directive in nginx that says to ignore headers with a '_' in the name.

http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers

That helped me, but rewriting your software to use the X- format may be even better.

like image 101
Jan Avatar answered Jan 03 '23 06:01

Jan