本文出至:编程社区
第四步:配置网站ssl,在自己网站的根目录下创建一个存放ssl的文件夹,把申请下来的ssl上传到创建好的文件夹里面
第五步:配置Nginx.加上这些就没问题了
<strong><span style="color:#000000">
</span></strong>
listen 443; ssl on; ssl_certificate_key /www/ blog.454142.com/public/ssl/pastdust.key; ssl_certificate /www/blog.454142.com/public/ssl/pastdust.pem;
443; ssl on; ssl_certificate_key /www/ blog.454142.com/public/ssl/pastdust.key; ssl_certificate /www/blog.454142.com/public/ssl/pastdust.pem;
第六步:强制让所有HTTP跳转到HTTPS
HTTP跳转到HTTPS
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;
($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;
第七步:一定要把443端口放开,让其可以通过
本文出至:编程社区