Nginx preventing renewal of certificate

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. https://crt.sh/?q=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: chuo.fm

I ran this command: certbot renew

It produced this output:
Cert is due for renewal, auto-renewing…

Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: [emerg] no “events” section in configuration

nginx: configuration file /etc/nginx/nginx.conf test failed

Could not choose appropriate plugin: 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: the configuration file /etc/nginx/nginx.conf syntax is ok\nnginx: [emerg] no “events” section in configuration\nnginx: configuration file /etc/nginx/nginx.conf test failed\n’,)

Attempting to renew cert (chuo.fm) from /etc/letsencrypt/renewal/chuo.fm.conf produced an unexpected error: 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: the configuration file /etc/nginx/nginx.conf syntax is ok\nnginx: [emerg] no “events” section in configuration\nnginx: configuration file /etc/nginx/nginx.conf test failed\n’,). Skipping.

All renewal attempts failed. The following certs could not be renewed:

/etc/letsencrypt/live/chuo.fm/fullchain.pem (failure)


The following certs are not due for renewal yet:

/etc/letsencrypt/live/chuo.fm-0001/fullchain.pem expires on 2019-12-05 (skipped)

All renewal attempts failed. The following certs could not be renewed:

/etc/letsencrypt/live/chuo.fm/fullchain.pem (failure)


1 renew failure(s), 0 parse failure(s)

My web server is (include version): nginx

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

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):

Hi,

This is a generic error from Nginx (your web server).
There is a simple way to resolve this, but please first check if there's any line match event{ in your Nginx configuration file /etc/nginx/nginx.conf/.

If there's no match, please add event{} before the giant http[ block.

Thank you

I checked my nginx.conf file and it turned up to be empty. I do have a backup of it on my laptop but when i try to replace the server file (showing size 0 bytes) with the one on my laptop (1412 kb) it turns up empty when reached on the server. Any ideas why would that be happening ?

1 Like

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