宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 解决办法
  3. 正文

在window中nginx安装腾讯云ssl报错nginx: [emerg] cannot load certificate

2021年1月2日 300点热度 0人点赞 0条评论

在配置window下的nginx的时候出现了

nginx: [emerg] cannot load certificate "C:/ssl/1_flyrun.work_bundle.crt": BIO_ne
w_file() failed (SSL: error:02001003:system library:fopen:No such process:fopen(
'C:/ssl/1_flyrun.work_bundle.crt','r') error:2006D080:BIO routines:BIO_new_file:
no such file)

首先nginx在windows配置腾讯云的openssl模块是已经安装好的,所以不需要考虑是ssl模块未安装

其次发现这里的地址出现了问题,应该是搜寻nginx文件下的ssl文件夹下的ssl配置文件,所以对nginx进行以下的调整

 server {
     listen       443 ssl;
     server_name  域名地址;
 
     ssl_certificate      ../ssl/1_域名_bundle.crt;
     ssl_certificate_key  ../ssl/2_域名.key;

     ssl_session_cache    shared:SSL:1m;
     ssl_session_timeout  5m;

     ssl_ciphers  HIGH:!aNULL:!MD5;
     ssl_prefer_server_ciphers  on;

     location / {
         root   html;
         index  index.html index.htm;
     }
 }

需要注意当错误为

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" direct
ive instead in C:\nginx-1.19.1/conf/nginx.conf:146

新版本的ssl配置为listen 443 ssl;

旧版本为

listen 443;
ssl on;

原文链接:https://blog.csdn.net/qq_41525746/article/details/109372904

Post Views: 1,494
标签: 暂无
最后更新:2022年1月26日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 渔人码头. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2