When I try to add ssl certificate for a -domain.com on the nginx server, It gets installed and works but the other existing old-domain.com show a certificate error
This server could not prove that it is old-domain.com; its security certificate is from new-domain.com.
This may be caused by a misconfiguration or an attacker intercepting your connection.
After removing certificate for new-domain and reloading nginx, the old one works back fine. But not together.
certbot --nginx --cert-name new-domain.com -d new-domain.com -d www.new-domain.com
I missed anything ? Please suggest
certbot version: 1.32.0
nginx version: nginx/1.18.0
Ubuntu Version: 22.04 LTS