With some of the recent search engine changes, It’s not uncommon to want your site to run completely under https. If you’re running on AWS with an Elastic LoadBalancer in place, then you have to go about it a bit differently so you don’t end up with a redirect loop. Also, if you have some type of page that is being requested for your healthcheck then you’ll need to exclude that from the redirect as well or the healthcheck will fail.

Here is a simple setup with Nginx. This also does not redirect any facebook bot requests since this can impact your facebook share counts. Just put this inside your server block in your nginx config.