linux免费https证书申请教程

linux免费https证书申请教程
直接去阿里云 菜单有个证书服务
进去有个购买证书菜单 选择免费的 然后会提示写个人资料 然后系统生成csr 然后提交审核
这个时候会有份邮件 文件下载上传到你的服务器 验证 (因为我用的是文件验证方式)

审核通过后 阿里云后台证书服务 里可以下载证书啦
解压上传到nginx目录conf mkdir cert 证书文件上传上去 如图下

<img src="http://newmiracle.cn/wp-content/uploads/2017/01/QQ截图20170112135059-300x94.png" alt="QQ截图20170112135059" width="300" height="94" class="alignnone size-medium wp-image-1007" />

接下来改nginx.conf配置
添加个443端口 因为https是443端口 然后证书路径改下就Ok nginx -s reload重启
<pre>
server {
listen 443;
server_name www.newmiracle.cn newmiracle.cn;
ssl on;
charset utf-8;

index index.html index.htm;
ssl_certificate cert/213996993440360.pem;
ssl_certificate_key cert/213996993440360.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;
location / {
root /home/www/wordpress;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /home/www/wordpress;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass 127.0.0.1:9001;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
#try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}
</pre>
然后https://newmiracle.cn可以访问啦 ps:如果访问是直接下载 那过几个小时看看吧 可能没更新

 

posted @ 2019-11-16 17:31  newmiracle宇宙  阅读(1076)  评论(0编辑  收藏  举报