阿里云提供免费的https安全证书服务:
位置:在阿里云的安全,证书服务下面,可以创建免费的安全证书
点击购买证书
选择免费型,点击立即购买
审核时间大约10分钟,通过之后点击下载
点击下载证书,会下载一个压缩文件,通过Windows的shell终端可以把文件托拉拽到指定目录下:
/etc/nginx/cert
关于配置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; } }
【相关推荐】
1. 微信小程序完整源码下载
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!