The key file belongs to a different certificate
CommonA renewal or re-issue created a new key and the configuration still points at the old one, or two sites' files were swapped.
Confirm
openssl x509 -in CERT.pem -noout -pubkey | sha256sum openssl pkey -in KEY.pem -pubout | sha256sum
Two different hashes
Fix
- Find the key whose hash matches the certificate's, and set ssl_certificate_key to it.
- With certbot, use the fullchain.pem and privkey.pem from the same live/DOMAIN directory; a second directory such as DOMAIN-0001 is a separate certificate with its own key.
- Then nginx -t, and reload only when it passes.
sudo nginx -t && sudo systemctl reload nginx
nginx -t passed on nginx 1.24.0 once the key matched.