NGINX server in Docker

Hello everyone, please help me because I really don't know how can I fix it.

I’m having trouble with my NGINX server running in a Docker container. I’m trying to set up SSL using Certbot, but I’m encountering errors.

Before it was okay and created but when I delete and tried again try write command
sudo certbot certonly --nginx

I have message:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] open() "/etc/letsencrypt/options-ssl-nginx.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/default:147
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] open() "/etc/letsencrypt/options-ssl-nginx.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/default:147\nnginx: configuration file /etc/nginx/nginx.conf test failed\n')
Ask for help or search for solutions at See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

I don't know how to fix it.

table { border: 1px solid #c4c7c5; border-radius: 4px; font-size: 16px; } th { padding: 18px 16px; text-align: left; } td { padding: 16px; border-top: 1px solid #c4c7c5; } button.js-code-copy { display: none; } .katex-mathml{ display: block; text-align: center; } .katex-html { display: none; }

To use the --nginx plugin Certbot needs access to the nginx system. Unless they are both in the same container that method won't work.

You need to use --webroot or DNS challenge or something else.

1 Like

Hi @Gambi99, and welcome to the LE community forum :slight_smile:

That file was moved or deleted.
If you can find it, move it back OR put a copy of it there.
If you can't find it, you could remove the line that tries to use it:

OR remove that entire vhost [if you don't use/need it].


Hello guys and thank you for your helping, support from hosts help me/

1 Like

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