Wildcard certificate for *.domain.com


(nudylady) #1

This is my caddyfile

1837jewel.com {
root /var/www/html/
}
*.1837jewel.com {
tls {
max_certs 5000
}
root /var/www/html/
}

1837jewel.com worked
*.1837jewel.com sometimes works and sometimes does not work. Chrome browser gives warning.

The domain with name.com default nameservers.
DNS Records:
A *.1837jewel.com 104.248.215.58

A 1837jewel.com 104.248.215.58

I guess I need a wildcard certificate for all subdomains. Anyone has a code example of this?

https://caddyserver.com/docs/automatic-https#wildcards
This article tells Environment Variables to Set. Where do I do this? in a caddyfile?

*.xxx.com {
proxy / https://example.com
tls wildcard.crt wildcard.key
}
Does this code work?


(Matthew Fay) #2

In the environment of your operating system: https://en.wikipedia.org/wiki/Environment_variable

If you have a wildcard certificate from another source and supply it to Caddy, that configuration will use it. Supplying your own certificate breaks Automatic HTTPS, so you will need to configure the HTTP and HTTPS listeners manually (or your wildcard site will be served on the default port instead).


(nudylady) #3

Finally I cannot work out on https for *.domain.com. thanks for help anyway