nginx下http跳转到https

代码如下
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}