Automatically switch between SSL and non-SSL with Nginx+Unicorn+Rails

Scroll down for setup instructions. Or, read this bit about SSL in the real world first. SSL or Secure Socket Layer is a nice way to secure sensitive parts of your Rails application. It achieves to goals. Firstly is encrypts all traffic between you and the remote server. Consider the passwords and personal information you submit to websites. When unencrypted (using HTTP), all this data is sent over the internet for all to read.