I am trying to configure a Rails application with SSL, using Nginx and Unicorn. I am trying to set it up locally. For that I first created a self-signed certificate using OpenS
You are missing a header:
proxy_set_header X-Forwarded-Proto https;
Let me cite a comprehensive post that explains nicely how Rails deals with HTTPS on Nginx:
force_ssl
relies on theHTTP_X_FORWARDED_PROTO
HTTP header to determine whether or not the request was an HTTPS request. If this setting isn't set tohttps
then you will end up with an infinite redirect loop asforce_ssl
will always think the forwarded request isn't HTTPS.