Possible Duplicate:
Why am I getting infinite redirect loop with force_ssl in my Rails app?
I have this in my application controller:
before_filter :redirect_to_ssl!
def redirect_to_ssl!
redirect_to "https://" + request.host + request.fullpath if !request.ssl? && Rails.env.production?
end
However, when I view my site (in production mode) with https:// it goes in a redirect loop... It appears that request.ssl? returns false even though I am using the https protocol..... Now, when I view my site, the browser does warn me that my ssl certificate can't be verified-- I am wondering if that is why request.ssl? returns false? What is a good workaround? Should I just check to see if the request.protocol == "https://" ?