eorywq
Last Updated: February 25, 2016
·
1.75K
· 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

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