zoukankan      html  css  js  c++  java
  • 微信小程序开发(6) SSL证书及HTTPS服务器

    1. 域名

    在万网购买,略

    2. 云服务器

    阿里云购买,略

    3. 安装lnmp

    使用lnmp.org程序,略

    4. 申请证书

    阿里云-管理控制台-安全(云盾)-证书服务-购买证书
    证书类型: 免费型DV SSL
    选择品牌: Symantec

    购买成功后,绑定域名,配置DNS解析记录生效

    5. 配置HTTPS服务器

    Nginx的安装目录下创建cert目录
    下载证书,放到cert目录
    修改nginx.conf文件,加入443端口及证书目录

    server
        {
            listen 80;
            listen 443 ssl;
            #listen [::]:80;
            server_name cet.fangbei.org;
            index index.html index.htm index.php default.html default.htm default.php;
            root  /home/wwwroot/cet.fangbei.org;
    
            include none.conf;
            #error_page   404   /404.html;
            include enable-php.conf;
    
            ssl_certificate /usr/local/nginx/cert/214130435490250.pem;
            ssl_certificate_key /usr/local/nginx/cert/214130435490250.key;
    
            location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }
    
            location ~ .*.(js|css)?$
            {
                expires      12h;
            }
    
            location ~ /.
            {
                deny all;
            }
    
            access_log off;
        }

    重启lnmp即可。

    6. 使用https访问网站

    支持80端口和443访问

    http://cet.fangbei.org/

    https://cet.fangbei.org/

    https访问时,可以看到证书

  • 相关阅读:
    ajax的post请求
    ajax的get请求
    浏览器缓存机制
    php和cookie
    php表单(2)
    php和表单(1)
    枚举for/in
    .Matrix-Beta冲刺的汇总博客
    .Matrix汇总博客
    小黄衫获得的感想
  • 原文地址:https://www.cnblogs.com/txw1958/p/weapp-ssl-https.html
Copyright © 2011-2022 走看看