添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
俊秀的凳子  ·  C++ ...·  1 年前    · 
没有腹肌的排球  ·  无法解析来自 xml ...·  1 年前    · 

nginx配置ssl证书时,启动报错,无法找到证书文件,报错日志如下:

2021/11/24 15:52:19 [emerg] 4124#3800: cannot load certificate "E:
ginx-1.21.4\ssl\6667030_xxxx.pem": BIO_new_file() failed (SSL: error:0200107B:system library:fopen:Unknown error:fopen('E:
ginx-1.21.4\ssl\6667030_xxxxxx.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)
2021/11/24 15:53:33 [emerg] 1832#4972: cannot load certificate "E:
ginx-1.21.4\ssl\6667030_xxxx.pem": BIO_new_file() failed (SSL: error:0200107B:system library:fopen:Unknown error:fopen('E:
ginx-1.21.4\ssl\6667030_xxxx.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)

解决方法一:

将E盘的地址路径改成“\\”,之前写的是“ssl_certificate      E:\nginx-1.21.4\ssl\6667030_xxxx.pem”,就一直报错

 server {
        listen       443 ssl;
        server_name  xxxx;
        ssl_certificate      E:\\nginx-1.21.4\ssl\6667030_xxxx.pem;
        ssl_certificate_key  E:\\nginx-1.21.4\ssl\6667030_xxxx.key;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
		location /api/ {
			client_max_body_size 1000m;
			alias   E:\dev\Server\api/;
            index  index.html index.htm;

 解决方法二:

可以查看log日志,其实日志里已经说明了原因,仔细查看一下路径,应该是\n被转义了,特别是整个路径里有带\n的都会被转义,比如D:\dev\server\nigix\nginx-1.16 就会出现这个问题,日志里会记录:D:\dev\serverigixginx-1.16,无法加载证书。

因此需要更改路径地址,或者双斜杠。

2016/03/21 16:57:10 [emerg] 30420#29876: BIO_new_file("C: ginx-1.9.9\ssl\1_liuyingguang.cn_bundle.crt") failed (SSLerror:0200107B:system library:fopen:Unknown error:fopen('C: ginx-1.9.9\ssl\1_liuy 根本原因nginx配置的ssl证书地址不正确,但明明证书就是在这个目录下放着的,最后发下是由于我的nginx使用docker容器化,用docker容器启动的nginx挂载在docker内部的地址和外部的是不一样的,后面把ssl证书路径改为docker内部的路径后成功启动。 nginx -c nginx2.conf nginx: [emerg] BIO_new_file("./conf/cert/nginx.pem") failed (SSL: error:02001003:system library:fopen:No such process:fopen(’./conf/cert/nginx.pem’,‘r’) error:2006D080:BIO routines:BIO_new_file:no such file) nginx配置文件中配置了ssl协议,但ng Stoping nginx... nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/cert/214291778530222.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/c cannot load certificate "/usr/local/nginx/ssl/*.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/ssl/*.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) 报错信息 SSL: error:0200107B:system library:fopen:Unknown error:fopen 注意事项: 其中ssl_certificate 配置的证书路径为docker容器内部路径,不是数据卷文件路径 # 容器内被赋予... 因为应用是在沙箱(sandbox)中的,在文件读写权限上受到限制,只能在几个目录下读写文件: Documents:应用中用户数据可以放在这里,iTunes备份和恢复的时候会包括此目录 tmp:存放临时文件,iTunes不会备份和恢复此目录,此目录下文件可能会在应用退出后删除 Library... nginx: [emerg] cannot load certificate “/etc/nginx/hui.ifreeshare.com.crt”: BIO_new_file() failed (SSL: error:0200100D:system …:system lib) 我正在我的Fedora服务器上安装一个nginx ssl代理. 我在/ etc / nginx下创建了一个证书和密钥对.它们看起来像这样: ls -l /etc/nginx/ total 84 -rw-r–r--. 1 root Nginx配置证书报错nginx: [emerg] cannot load certificate "../software/nginx/zhifu.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('../software/nginx/zhifu.pem','r') error:2006D080:BIO routines:BIO_new_file:no nginx: [emerg] BIO_new_file(“E:\nginx-1.12.2/conf/cert.pem”) failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘E:\nginx-1.12.2/conf/cert.pem’,‘r’) error:2006D080:BIO routines:BIO_new_file:no such file) 解决方法 : 方法1 - 配置证书 [admin@]$ ssh xxx.xxx.xxx.xxxAuto configuration failed140380265600672:error:0200100D:system library:fopen:Permission denied:bss_file.c:169:fopen('/etc/pki/tls/openssl.cnf','rb')140380265600...