How do I generate wildcard HTTPS certificates?
server {
server_name subdomain.domain.com www.subdomain.domain.com *.subdomain.domain.com ~^(.*)\.subdomain\.domain\.com$;
}
Currently, for normal domains, I generate certificates like this:
sudo certbot --nginx -d example.com
I used following to generate wildcard certificate and it worked like charm. Here we are doing dns challenge hence you should have access to your dns to make entries that will be read while create certificate.
sudo certbot certonly --manual -d *.example.com -d example.com \
--email [email protected] --agree-tos \
--preferred-challenges dns-01 \
--server https://acme-v02.api.letsencrypt.org/directory
Hope this information will help you
For wildcard just add another entry with *
sudo certbot --nginx -d *.example.com -d example.com
You can further refer here Let's Encrypt: Wildcard Certificate With Certbot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With