阿里云配置小程序证书 https总结

第一条 nginx.conf的配置过程中 请先另存一份 修改了两次其他的文件没动,但是nginx启动不了 ,估计是bom头的原因


操作步骤

步骤1:登录阿里后台 –> 证书服务 –> 点击购买证书(像商品购买) 
步骤2:购买后按提示绑定域名,提交等待审核(一般20分钟左右) 
步骤3:审核通过后,在我的证书订单列表中点击下载,进入选择下载对应不同服务器类型(apache, nginx, iss…)的证书文件(.pem, .key) 
步骤4:按提示的配置信息,上传刚下载的两个证书文件到服务器,并配置nginx.conf 
步骤5:nginx.conf 配置文件中添加:注要监听443 商品

配置文件:

server {
    # 监听443 端口
    listen 443;
    server_name www.xxx.com xxx.com;
    ssl on;
#   root html;
#   index index.html index.htm;
    # 证书路径
    ssl_certificate   /alidata/server/nginx-1.4.4/conf/cert/214134739980111.pem;
    # 私钥路径
    ssl_certificate_key  /alidata/server/nginx-1.4.4/conf/cert/214134739980111.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;



#   自定义部分, 注释了模板上面的二行
    index index.html index.htm index.php;
    root /alidata/www/www.xxx.com;

    error_page 404 /404.html;

    location ~ .*\.(php|php5)?$
    {
            #fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
            expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
            expires 1h;
    }

    # rewrite, log
    include /alidata/server/nginx/conf/rewrite/www.xxx.com.conf;
    access_log  /alidata/log/nginx/access/www.xxx.com.log;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

步骤6: 重启服务: /etc/init.d/nginx restart


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

可以吧可以吧

打赏可以获得大长腿妹子微信

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值