Error : nginx: [emerg] cannot load certificate "C: ginx-1.26.2\conf\cert\moisecret.crt": BIO_new_file() failed (SSL: error:8000007B:system librar
I was getting above error while setup nginx on windows machine. Actually after nginx configuration, I updated the config file placed under nginx folder(C:\nginx-1.26.2\conf).
I placed nginx in my local machine under C drive on below path.
C:\nginx-1.26.2\conf
To complete nginx configuration it is required to add certificate path in nginx config file. For reference I shared below screenshot which s having wrong secret path highlighted in below config file.
Issue get resolved right after updating secret paths as nginx was unable to get the certificates listed in nginx configuration file. for reference I am sharing correct path for both the certificate and it's key.
Correct path would be
ssl_certificate C:\\nginx-1.26.2\\conf\\cert\\moisecret.crt;
ssl_certificate_key C:\\nginx-1.26.2\\conf\\cert\\moisecret.key;
(OR)
ssl_certificate C:/nginx-1.26.2/conf/cert/moisecret.crt;
ssl_certificate_key C:/nginx-1.26.2/conf/cert/moisecret.key;