首页 > Web开发 > 详细

小程序配置https

时间:2018-05-30 16:01:55      阅读:318      评论:0      收藏:0      [点我收藏+]

问题:

1. 微信开发者工具中,通过不检验域名可以访问,手机预览访问不了的
-- 添加配置https的域名访问

申请https证书:

阿里云购买免费证书:
控制台-安全(云盾)-CA证书服务-购买-一个域名&Symantec-购买

nginx配置https:

#ci server=======start
    server {
        listen 80;
        #listen 443 ssl;
        server_name ci.mag998.com;
        
        root   /mnt/html/ci;
        index  index.php index.html index.htm;
        
        #ssl_certificate /usr/local/nginx/cert/214130435490250.pem;
        #ssl_certificate_key /usr/local/nginx/cert/214130435490250.key;

        location / {

            if (!-e $request_filename){
                rewrite ^/(.*) /index.php last;
            }
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
            include        fastcgi_params;
        }
        location ~ /\.ht {
            deny  all;
        }
    }
    #ci end============

小程序后台:

设置-开发设置-服务器域名-添加域名

 

小程序配置https

原文:https://www.cnblogs.com/maoriaty/p/9111344.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!