# Error while trying to generate a nginx cert

**URL:** https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616
**Category:** Help
**Created:** [September 17, 2022, 4:12pm UTC](https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616 "2022-09-17T16:12:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yexoo](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/yexoo/32/64040_2.png) [@Yexoo](https://community.letsencrypt.org/u/Yexoo)
#### Post date: [September 17, 2022, 4:12pm UTC](https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616/1 "2022-09-17T16:12:37Z")

</div>

Im working on installing on my server pterodactyl and i have a problem with nginx cert generation .

here the logs (ps. The domain is change only because i dont wont to publish it)

root@yexoserver:/home/yexo# certbot certonly --nginx -d   
Saving debug log to /var/log/letsencrypt/letsencrypt.log  
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] cannot load certificate "/etc/ssl/.pem": BIO\_new\_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/.pem, r) error:10000080:BIO routines::no such file)  
nginx: configuration file /etc/nginx/nginx.conf test failed

The nginx plugin is not working; there may be problems with your existing configuration.  
The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] cannot load certificate "/etc/ssl/.pem": BIO\_new\_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/.pem, r) error:10000080:BIO routines::no such file)\nnginx: configuration file /etc/nginx/nginx.conf test failed\n')  
Ask for help or search for solutions at [https://community.letsencrypt.org](https://community.letsencrypt.org). See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

---

<div class="post-metadata">

### Author: ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)
#### Post date: [September 17, 2022, 4:46pm UTC](https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616/2 "2022-09-17T16:46:15Z")

</div>

Welcome to the community @Yexoo

> [@Yexoo](#):
>
> Im working on installing on my server pterodactyl and i have a problem with nginx cert generation .

I don't know what pterodactyl is but your nginx config does not look right. You must have a working HTTP site to use the `--nginx` plug-in as it uses the [HTTP Challenge method](https://letsencrypt.org/docs/challenge-types/) to get a cert.

You can check your nginx config with this:

```nohighlight
nginx -t

```

You will need to correct any errors. You should see the same error Certbot saw:

> [@](#):
>
> No such file or directory:calling fopen(/etc/ssl/.pem, r) error:10000080:BIO routines::no such file)\nnginx: configuration file /etc/nginx/nginx.conf test failed\n')

---

<div class="post-metadata">

### Author: ![Bruce5051](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/bruce5051/32/76576_2.png) [@Bruce5051](https://community.letsencrypt.org/u/Bruce5051)
#### Post date: [September 17, 2022, 4:48pm UTC](https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616/3 "2022-09-17T16:48:26Z")

</div>

Hello @Yexoo,

> [@Yexoo](#):
>
> (ps. The domain is change only because i dont wont to publish it)

**Please fill out the fields below so we can help you better.** Note: you must provide your **domain name** to get help. **Domain names** for **issued certificates** are **all made public in [Certificate Transparency](https://community.letsencrypt.org/t/cant-get-new-renew-certificate-for-new-domain/184575/11) logs** (e.g. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot):

Thank you for assisting us in helping **YOU**!

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)
#### Post date: [October 17, 2022, 4:48pm UTC](https://community.letsencrypt.org/t/error-while-trying-to-generate-a-nginx-cert/184616/4 "2022-10-17T16:48:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
