Install certbot for nginx on centos6 error:Error while running nginx -c /etc/nginx/nginx.conf -t

Another colleague of mine has previously installed certbot, but it can’t renew now, I have tried many ways and I have not solved it, so I want to reinstall certbot to let it work.

My domain is:

I ran this command:
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo chown root /usr/local/bin/certbot-auto
sudo chmod 0755 /usr/local/bin/certbot-auto
sudo /usr/local/bin/certbot-auto --nginx

It produced this output:
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

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/nginx/nginx.conf” failed (2: No such file or directory)\nnginx: configuration file /etc/nginx/nginx.conf test failed\n’,)

My web server is (include version):
CentOS release 6.5 (Final)

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

My hosting provider, if applicable, is:

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

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 0.33.1

how to solve this problem or how to config path of nginx.conf ?

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