When nginx configures the SSL certificate, it starts with an error. The certificate file cannot be found. The error log is as follows:
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)
Solution:
Change the address path of disk e to “\\”, which was written as “ssl_certificate” E: “\nginx-1.21.4\SSL\6667030_xxxx.PEM”, it keeps reporting errors
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;
}
}