Accidentally overwrote /etc/nginx/sites-enabled now certbot causing nginx issues

I accidentally used ‘sudo mv admin.oldDomain.com newDomain.com’ instead of ‘sudo mv admin.oldDomain.com admin.newDomain.com’ which overwrote my sites-enabled config file.

I then ran ‘sudo cp newDomain.com admin.newDomain.com’ and changed all the references from newDomain.com to admin.newDomain.com however now I’m getting the error:

nginx: [emerg] duplicate listen options for [::]:443 in /etc/nginx/sites-enabled/admin.newDomain.com:15

How do I fix this?

Hi @JakeIQ

you can't have duplicated listen directives.

So remove one of these (perhaps the second).

Remove the duplicate option from all but one of the listen directives.

https://nginx.org/en/docs/http/ngx_http_core_module.html#listen

If the duplicate option is ipv6only=on, it's been on by default for years, so you can probably just remove it entirely.

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