TL;DR If you have compiled Passenger into Nginx, use
passenger_set_cgi_param instead of
proxy_set_header to set HTTP headers required by the rails process.
There are two ways of using Passenger and Nginx together. The first is when the two are compiled into one daemon that creates many processes as required. The second is using Nginx as a proxy in front of Passenger/Apache/Nginx processes running either on the same machine or on a different server altogether.
When using Nginx as a proxy, it can be configured to add or redefine http headers in the request. This is done using the
If you have compiled Passenger into Nginx, the above configuration will have no effect. This is because the request is not considered to be proxied by Nginx. To have the same effect you need to use the
Notice that the header name is all upper case, and has