I just upgraded from nginx 1.4.1 to 1.8.0 (along with an upgrade to Phusion Passenger 5.0.13). With that change the $scheme
variable from our configuration no longer seems be set.
The nginx configuration looks something like this:
server {
listen 80;
listen 443;
ssl on;
server_name app.example.com;
passenger_enabled on;
passenger_env_var HTTP_X_FORWARDED_PROTO $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
...
}
When I inspect request.env['HTTP_X_FORWARDED_PROTO']
or request.headers['X-Forwarded-Proto']
in the Rails application, I get the literal "$scheme", not "http" or "https".
I have tried both proxy_set_header
and passenger_set_header
and have the same results.