大网数据广告活动
服务器运维问答

Nginx startup fails ssl no such file or directory

· 52CE 我爱测

Here is the error I'm getting: Reloading nginx configuration: nginx: [emerg] SSL_CTX_use_certificate_chain_file("/path/to/cert.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory error:20074002:BIO ro…

问题原文

原帖链接 · tgoza · CC BY-SA 3.0

Here is the error I'm getting:

Reloading nginx configuration: nginx: [emerg] SSL_CTX_use_certificate_chain_file("/path/to/cert.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory error:20074002:BIO routines:FILE_CTRL:system lib error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib) nginx: configuration file /etc/nginx/nginx.conf test failed

I'm 100% sure that the file is at that location but Nginx seems to think that it's not there. I merged the domain.crt and intermediate.crt manually in that order. I've been scratching my head over this one all day. I hope someone has seen this error and has a solution.(and a side note it's not an error in pasting that the file location is show only once and not again after 'no such file or directory').

已采纳解答

原帖链接 · Jim · CC BY-SA 3.0

Are you sure that the Nginx user has access to the directory?

Also check the permissions of the .pem file, if Nginx cannot access it, it can show as 'no such file or directory'.

If the permissions are right, you might check the actual path again. How you pasted it (which I know you removed the dir) there is no beginning / which could be the problem.

EDIT

Try moving your SSL setup into the following structure (as well as change the nginx.conf to reflect):

sudo mkdir /etc/nginx/ssl
sudo chown -R root:root /etc/nginx/ssl
sudo chmod -R 600 /etc/nginx/ssl

Nginx could be failing on your .pem because the permissions are too open (need source to verify that Nginx does this) but the above setup should work fine.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-09-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。