If I open my FF developer tools, and look at the network tab, then enter http://mywebsite.com, there would be a 301 moved permanently to the https website as the first network request. If you do that to http://facebook.com, then the first request would be 200 with a request URL of https://facebook.com.
However, if you run a curl -I on both websites, the same result of 301 moved permanently would show. How do they do that?
I am using nginx that redirects to HTTPS behind Amazon ELB.