Reputation: 1451
I have Nginx serving the SSL. On the rails side it's a Puma and I have
config.action_mailer.default_url_options = { protocol: 'https', host: example.com
but my root_url
still returns http://example.com
Upvotes: 0
Views: 397
Reputation: 1451
You need to set proxy_set_header X-Forwarded-Proto https;
in your nginx config so Rails would see your request as HTTPS.
Here is another issue that is caused by absence of this header - force_ssl
would cause endless redirection: https redirect for rails app behind proxy?
UPDATE:
X-Forwarded-* headers are considered legacy now. Consider using Forwarded
https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/
Upvotes: 2