http 301 https

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;}
 

huan

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: