nginx: SSL: error:0200107B:system library:fopen:Unknown error:fopen

created at 11-24-2021 views: 1

When nginx configures the ssl certificate, an error is reported at startup, and 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 the E disk to \\, the previous one is ssl_certificate E:\nginx-1.21.4\ssl\6667030_xxxx.pem, and 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;
        }

    }
Please log in to leave a comment.