1.
if ($scheme = http ) {
return 301 https://$host$request_uri;
}
2.
server_name baidu.com ;
rewrite ^(.*) https://baidu.com$1 permanent
3.
if ($server_port = 80 ) {
return 301 https://$host$request_uri;
}
4.
server_name laobuluo.com ;
return 301 https://$server_name$request_uri;