Last Updated: February 25, 2016
·
1.957K
· bryckbost

Forward the Protocol from Nginx to Rails

Using Passenger and Nginx and want to run HTTP and HTTPS in parallel?

If you're not proxying, set the following to forward your scheme on to rails. From there, RackSSL or RackSSLEnforcer will know the request is SSL or not.

passenger_set_cgi_param HTTP_X_FORWARDED_PROTO $scheme;

1 Response
Add your response

proxy_set_header X-Forwarded-Proto $scheme
over 1 year ago ·