I was trying to implement https on a subdomain. I have included SSL_requriment plugin
my application controller has two statements:
include SslRequirement
ssl_required if ENV["RAILS_ENV"] == "production"
I have generated key, csr and crt and specified this in apache config file:
<VirtualHost *:80>
ServerName app.my_app.com
DocumentRoot /home/me/my_app/production/current/public
</VirtualHost>
<VirtualHost *:443>
ServerName app.my_app.com
DocumentRoot /home/me/my_app/production/current/public
SSLEngine on
SSLCertificateFile /home/me/my_app/production/shared/plusrev.crt
SSLCertificateKeyFile /home/me/my_app/production/shared/plusrev.key
</VirtualHost>
Still my subdomain is not redirecting to https. Anything I am missing.
Here is the solution.
Use
in you gemFile. Here is the gem guide
In your application controller: