Home > Back-end >  Nginx cannot load certificate in Windows
Nginx cannot load certificate in Windows

Time:09-29

When I try to switch Nginx, I a mistake on the error.log

[emerg] 3620#11288: cannot load certificate "C:/Users/username/localhost.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('C:/Users/username/localhost.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

And I don't know how to solve it.

this is server in nginx.conf

 server {
       listen       443 ssl;
       server_name   platform.local.com;
       ssl_certificate      /Users/username/localhost.crt;
       ssl_certificate_key  /Users/tusername/localhost.key;

       location / {
                proxy_pass https://localhost:3001;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                index  index.html index.htm;
       }
   }

CodePudding user response:

the path /Users/username/ doesn't exist you should replace username with your username

or the file localhost.crt doesn't exist in the path /Users/username/

  • Related