listen 80;
listen 443 ssl;
#下面两个一样的效果
if ($scheme = http ) { return 301 https://$host$request_uri;}
if ($server_port = 80 ) { return 301 https://$host$request_uri;}
if ($server_port = 80) {return 301 https://$server_name$request_uri;}
if ($scheme = http) {return 301 https://$server_name$request_uri;}