参考:
免费申请网站SSL证书 有效期15年 全站开启https_哔哩哔哩_bilibili
总结:
登陆www.cloudflare.com
注册账号
Add a Site 增加站点
站点设置完毕后Add record
![](https://img-blog.csdnimg.cn/5e309fd8ea424c72b587098e8aa59e7a.png)
![](https://img-blog.csdnimg.cn/72cc60e829c8479e916140037735191c.png)
![](https://img-blog.csdnimg.cn/6fdefd48d40147ecbbec4876e0604057.png)
记住这个Proxy status一定要勾选,这是cloudflare代理https请求转发到你的服务器,否则证书将不可信
ssl设置
1.overview
flexible和full都可以
![](https://img-blog.csdnimg.cn/7aceb66495d848f1b18671b759f4cd09.png)
2.Edge Certificates
![](https://img-blog.csdnimg.cn/d619fc8e33de48a983b7aa41a2423cfb.png)
![](https://img-blog.csdnimg.cn/69419ec66b784a6ba9d1cf2c4be0799c.png)
3.Origin Server
创建证书
4.nginx.conf,记得更改监听443配置的servername为域名(localhost将无法访问)
5.nginx如何配置暂略,网上挺多的
6.服务器记得防火墙开启443接口,否则也不能访问