阿里云、腾讯云提供免费的ssl证书搭建https网站方法

阿里云、腾讯云提供免费的ssl证书搭建https网站方法

一、阿里云购买免费证书

地址:https://common-buy.aliyun.com/?spm=5176.2020520163.cas.1.AM0zfg&commodityCode=cas#/buy

阿里云、腾讯云提供免费的ssl证书搭建https网站方法

选择免费型DV SSL证书


下一步。。。再到阿里云的后台上,会需要补全信息的

阿里云、腾讯云提供免费的ssl证书搭建https网站方法

填写域名

阿里云、腾讯云提供免费的ssl证书搭建https网站方法

文件验证


文件验证:


文件验证方式可能会创建隐藏目录,如果是Windows服务器或用了阿里云的OSS服务,请选择DNS方式。

1.下载专有的验证文件fileauth.htm,不要编辑该文件,有效期3天,过期后请重新下载
2.将该文件上传到:demo.funet8.com/.well-known/pki-validation/
3.用浏览器访问http://demo.funet8.com/.well-known/pki-validation/fileauth.htm或https://demo.funet8.com/.well-known/pki-validation/fileauth.htm,确认上传成功

完成验证之后,下载证书。

腾讯云密钥方法类似:
https://www.qcloud.com/product/ssl

二、nginx配置

#mkdir /data/conf/cert/
#cd /data/conf/cert/
重命名上传密钥

修改nginx的配置文件

##################https---demo.funet8.com################################################
server {
        listen 443;
        server_name demo.7477.com;
        error_log /你的路径/ssl_demo.funet8.com-error.log;
        access_log /你的路径/ssl_demo.funet8.com-access.log;
        ssl on;
        root /data/demo_funet8_com;
        ssl_certificate /data/conf/cert/demo_funet8_com.pem;
        ssl_certificate_key /data/conf/cert/demo_funet8_com.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        location / {
            index index.html index.htm;
        }
}
#########################所有http都跳转到https###############################
server {
    listen       80;
    server_name demo.funet8.com;
    rewrite ^/(.*) https://demo.funet8.com/$1 permanent; #关键代码
}  

如果出现“[emerg] 10464#0: unknown directive “ssl” in /usr/local/nginx-0.6.32/conf/nginx.conf:74”则说明没有将ssl模块编译进nginx,在configure的时候加上“–with-http_ssl_module”即可^^

CDN的问题:

由于demo.funet8.com使用了360免费的CDN服务,还需要在CDN后台上传证书.

360帮助文档:http://bbs.360.cn/thread-7015083-1-1.html

如果使用其他的CDN也需要在后台上传证书。

http://demo.funet8.com/

https://demo.funet8.com/

访问以上链接。

防火墙开放:443端口(此步骤没有操作)

/sbin/iptables -I INPUT -p tcp --dport 443 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables restart

参考:
http://www.sinzi.org/lnmp-nginx-aliyun-https-ssl/

评论

  1. 7年前
    2017-3-14 10:27:30

    群发软件免费下,无限广告免费发,
    百万流量免费享,十级提成免费拿。
    增达网免费注册网址:
    http://www.a111888.zengda.xin/
    QQ:2042970736

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇