Passing Headers along while Proxying with nginx

When you’re proxying requests via nginx, you might assume after reading the documentation that every header is forwarded, except for the Host and Connection headers.

You’d also be wrong.

nginx drops all headers with an underscore in them.

This is a configurable settings. You can turn it on with a simple

underscores_in_headers on

I’m still baffled as to *why* this is a configuration parameter. And why it is turned off by default. And why there is no mention of it in the proxy docs.

Thanks to kolbyjack on #nginx for helping me figure this out.