if ($scheme = "http") {
    return 301 https://$host$request_uri;
}