server declaration in my nginx.conf:
listen 1.2.3.4:443 ssl; root /var/www/myapp/current/public; ssl on; ssl_certificate /etc/nginx-cer
You can pass :protocol => "https", to redirect_to.
:protocol => "https"
You can set this as a default by adding the following to application.rb
Rails.application.routes.default_url_options[:protocol]= 'https'
Reference: https://stackoverflow.com/a/6101147/446203