这篇文章上次修改于 418 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

申请Let's Encrypt提供的免费证书,在根据说明使用certbot配置ssl证书时出现错误提示:

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.")

需要指定nginx及配置的路径:

#仅下载证书
certbot certonly --nginx --nginx-ctl /usr/local/openresty/nginx/sbin/nginx --nginx-server-root /usr/local/openresty/nginx/conf
#下载并自动安装证书
certbot --nginx --nginx-ctl /usr/local/openresty/nginx/sbin/nginx --nginx-server-root /usr/local/openresty/nginx/conf