https 是个好东西, 它能让为你的信息进行加密, 让信息更安全, chrome 会将没有 https 的网站标记为 "不安全"
早些时候, 将 http 转换为 https 是需要收费的, 但现在有了一些开源项目, 为我们提供免费的 https 服务,
更可贵的是, 不仅免费, 而且安装非常简单
免费 https 项目主页: https://certbot.eff.org/
按需获取 https 安装脚本
选择服务软件 (apach 和 nginx)
选择操作系统类型
详细步骤: 以 nginx 配合腾讯云 centos7 镜像为例
安装 epel 增强源 (腾讯云的 centos7 镜像是配置好的, 可以跳过这一步)
- yum -y install epel-release
- wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
- # 刷新 yum 源
- yum clean all && yum makecache && yum update
安装 yum-utils
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
安装 python2-certbot-nginx
yum install python2-certbot-nginx
将 cerbot 配置到 nginx
certbot --nginx
输入你的邮箱名
同意协议
允许邮件推送
选择添加 https 的域名
对配置子域名有疑问的, 可以查看我之前写过的 nginx 配置二级域名
同时保留 http 和 https
配置完成, 查看测试报表
测试 zhaoolee.com
查看网站
https://zhaoolee.com/
子域名: https://git.zhaoolee.com/
子域名 https://cloud.zhaoolee.com/login
同时原 http 连接方式不受影响 http://zhaoolee.com/
免费证书续期
目前安装的 https 每隔 90 天, 就会失效, 你可以在失效之前使用
certbot renew --dry-run
命令, 免费进行续费更新
小结:
随着谷歌强制推行 https, 支持 https 的网站也越来越多, 博主认为这是一件好事, 能让我们在互联网的数据更安全, 记得听过一期网络安全公开课, 课上推荐将 http 改为 https 的种种好处, 而且还推荐了将支持 https 网站的所有 http 请求强制转换为 https 的插件, chrome 插件链接 HTTPS Everywhere
来源: http://www.jianshu.com/p/d38e93614735