今天在一台 CentOS 7.3 的服务器上配置新网站域名的 HTTPS 证书,Web Server 用的 Nginx。
certbot 提示 nginx.conf 文件找不到。
# certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running nginx -c /etc/nginx/nginx.conf -t.
nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
但是这台服务器是用的某 panel 安装的 Nginx,所以 nginx.conf 文件并不在默认的路径上。查了半天才找到自定义路径的方法:
certbot --nginx --nginx-server-root=/some/other/path/nginx/conf
关于作者
我是来自山东烟台的一名开发者,有敢兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式