在nginx配置文件server 段里面中加入下面代码:
server { if ($server_port = 80){ return 301 https://$server_name$request_uri;} if ($scheme = http){ return 301 https://$server_name$request_uri;} error_page 497 https://$server_name$request_uri; }
靳闯博客
在nginx配置文件server 段里面中加入下面代码:
server { if ($server_port = 80){ return 301 https://$server_name$request_uri;} if ($scheme = http){ return 301 https://$server_name$request_uri;} error_page 497 https://$server_name$request_uri; }