Related: Add www to non-www address with ssl
I'm working with a Rails app and having a ton of issues getting SSL for certain routes to work. I thought I'd instead just do a brute force approach and solve this in nginx config... fewer moving parts involved, more certain to work is my thinking.
For example, let's say I have a path that looks like 'http://mysite.com/users/sign_in'. Would I force that path to use SSL like so?
location / {
rewrite ^http://(.*)(/users/sign_in/)(.*)$ https://$1$2$3 permanent;
}
Can anyone recommend a good resource for doing this sort of https/http redirection in nginx?
Not an answer to your question, but an answer to your problem: Only encrypting the login page is almost as dangerous as not encrypting anything. If security is important, encrypt everything -- http://codebutler.com/firesheep