Home > WeChat Applet > Mini Program Development > How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

零下一度
Release: 2017-05-19 15:18:09
Original
4400 people have browsed it

小程序需要https协议,需要安全证书,没接触过https开发的同学可能就一头雾水,无从下手了。整理此文的目的就是为了解决这个问题:

阿里云提供免费的https安全证书服务:

  • 位置:在阿里云的安全,证书服务下面,可以创建免费的安全证书

  • 点击购买证书

    How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

    购买证书

  • 选择免费型,点击立即购买

    How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

    购买免费型

  • 审核时间大约10分钟,通过之后点击下载

    How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

    点击下载

  • 点击下载证书,会下载一个压缩文件,通过Windows的shell终端可以把文件托拉拽到指定目录下:
    /etc/nginx/cert

    How to apply for a security certificate for small program development? Share the steps to apply for an http certificate

    下载证书

  • 关于配置nginx

    server {
     listen       80;
     listen       443 ssl;
     server_name  xxx.maiyatian.com;
     root         /home/wangzhongyang/xxx/public/;
     index        index.php;
    
     ssl on;
     ssl_certificate   cert/214088335340610.pem;
     ssl_certificate_key  cert/214088335340610.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;
    
     access_log  /data/logs/nginx/www.mhsy.com.access.log main;
     error_log  /data/logs/nginx/www.mhsy.com.error.log;
    
     rewrite "^/([A-Za-z]+)/([A-Za-z]+)/$" /index.php?c=$1&a=$2&$query_string last;
     rewrite "^/([A-Za-z]+)/$" /index.php?c=$1&a=index&$query_string last;
    
     error_page  404              /404.html;
     error_page  500 502 503 504  /50x.html;
    
     location ~ \.php$ {
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         include        fastcgi_params;
     }
    
     location ~ /\.ht {
         deny  all;
     }
    }
    Copy after login

【相关推荐】

1. 微信小程序完整源码下载

2. 百度翻译;翻译API+历史翻译记录

3. 点击tabbar变换图标

The above is the detailed content of How to apply for a security certificate for small program development? Share the steps to apply for an http certificate. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template