rails/rails — Issue #4169: There are no more proxy variables in request.env
Author: Bregor
Created: 2011-12-24 18:40:01+00:00
State: open

**Environment**:

* Rails-3.2.0.rc1
* Ruby-1.9.3-p0
* Unicorn-4.1.1
* NGINX-1.0.7

In nginx vhost config:

...
location @unicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://ivan-asterisk-dev.yamoney.ru;
}
upstream ivan-asterisk-dev.yamoney.ru {
server unix:/tmp/unicorn-testing.sock;
}
....

In **request.env**:

{
"REMOTE_ADDR"=>"127.0.0.1",
"REQUEST_METHOD"=>"POST",
"REQUEST_PATH"=>"/users/auth/ldap/callback",
"PATH_INFO"=>"/users/auth/ldap/callback",
"REQUEST_URI"=>"/users/auth/ldap/callback",
"SERVER_PROTOCOL"=>"HTTP/1.0",
"HTTP_VERSION"=>"HTTP/1.0",
"HTTP_HOST"=>"ivan-asterisk-dev.yamoney.ru",
"HTTP_REFERER"=>"https://ivan-asterisk-dev.yamoney.ru/users/sign_in",
....
}

There are no X-Real-IP and other vars in request.env.

With rails-3.1 there are all in place.