zoukankan      html  css  js  c++  java
  • 小程序配置https

    问题:

    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============

    小程序后台:

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

     注意:

    如果配置正确访问不了:服务器要开启443端口
  • 相关阅读:
    OC block声明和使用
    OC 内存管理(retain和release)
    OC @class关键字
    OC typedef(起别名)
    OC static 和函数
    OC static 和变量
    java【基础】日期操作
    java【基础】正则表达式
    理解String拼接,+运算符重载的实际效果
    swoole的EventLoop学习
  • 原文地址:https://www.cnblogs.com/maoriaty/p/9111344.html
Copyright © 2011-2022 走看看