# https://devcenter.heroku.com/articles/http-routing#heroku-headers # http://wiki.nginx.org/HttpCoreModule#.24http_HEADER # redirect all http to https with 301 if ( $http_x_forwarded_proto = http ) { return 301 https://$host$request_uri; }