HOWTO: Force https/SSL for Apache2, Phusion Passenger and Rails

There’s a lot of buzz right now about Firesheep and non-secure Rails applications.

This is a pretty simple problem to solve with Apache’s mod_rewrite. If the traffic isn’t on https, force it to be. This configuration only needs to be in production, of course.

Here’s /etc/apache2/sites-enabled/adgrok:

Note that all of our CSS references relative paths, and we use named routes in our rails views, which takes care of the other URLs.

Posted in Technical HOWTOs Tagged with: , ,
  • lauraine 2012

    I have no words for this great post such a awe-some information i got gathered. Thanks to Author.
    Flash Video Player