Nginx automatic editing configuration failed

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 logs (e.g. crt.sh | 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:
gaslab.ddns.net

I ran this command:
sudo certbot --nginx

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.")

My web server is (include version):
NGINX


I can't find out the version of NGINX used.
I made a screenshot of my task manager to show the process in execution.

The operating system my web server runs on is (include version):
CasaOs 0.4.15 on Debian GNU/Linux 11 (bullseye)

My hosting provider, if applicable, is:
myself

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

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

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

The --nginx plugin makes assumptions about the location of the nginx binary and config path based on the o/s it runs on. I am guessing the casaos path isn't the standard default path.

You have two options. Personally, I'd lean towards using --webroot and a --deploy-hook instead of --nginx.

The --nginx option works by making a temp change to your nginx config, reloading it to effect those changes, making the cert request, undoing the temp config change and reloading nginx again to remove them from actively running nginx. This requires a close interaction of your nginx system and Certbot --nginx plugin.

The --webroot option just writes a challenge token file to the path you give with --webroot-path. The cert request is made and the token file removed after. The --deploy-hook can reload nginx whenever you get a fresh cert (not every time Certbot runs).

To get the --nginx option to work on "non-standard" installs review the Certbot docs (here) for

--nginx-server-root NGINX_SERVER_ROOT
--nginx-ctl NGINX_CTL

Another key difference is that --nginx option will create a server block for port 443. With --webroot you need to make one manually after you get a cert. Certbot uses the Mozilla recommendations here: Mozilla SSL Configuration Generator

2 Likes

[quote="MikeMcQ, post:2, topic:231591, full:true"]

MikeMcQ, thank you for your reply.

I am a really noob and i'm not sure I understood correctly.

With the command

--nginx-server-root

I can give the correct path of the root directory for NGINX to certbot,

and

--nginx-ctl

is for the path of the binary.

Once given the right parameters to certbot, the command

sudo certbot --nginx

will be successful.

Thanks.

I believe that should be the path to the initial nginx config file. On my system my nginx.conf file is at /etc/nginx

But, other systems my use different conf file name and/or folder.

1 Like