I have a Wordpress multisite setup using Trellis and Bedrock. The point of this website means that it involves adding new domain names on a regular basis. I do this by adding the new domain name, for example domain2.com, to the wordpress_sites.yml file like this:
site_hosts:
- domain1.com
- domain2.com
I use Let’s Encrypt for SSL certificates, which worked like a charm for the initial domains – but not for the domains I added later. At first I got an error when running ansible-playbook server.yml -e env=production that the DNS record should point to the webserver (which it already did), but I solved that by setting
ssl:
enabled: false
Then running ansible-playbook server.yml -e env=production, change it back to
ssl:
enabled: true
And then running ansible-playbook server.yml -e env=production again. I think the DNS Let’s Encrypt error stopped Nginx from updating the vhost. This way Let’s Encrypt had no way to reach the webserver to verify it.
After that verification worked like a charm and I got all greens when running the server playbook.
The problem is that Chrome returns a red lock saying the certificate is not valid for domain2.com. Yet is still is valid for domain1.com. Is this because there was already a certificate issued for the main domain? If so, how do I go about fixing this?