Fix rack-ssl with load balancers

Check if ssl is terminated at the load balancer (such as ELB). Otherwise we get in a redirect loop.