I am in a situation where i have to use HTTPS. (chrome decided to stop getUserMedia in HTTP ).
The Question is, is it possible to assign wildcard Domains? Here are a few of my sites
- test.nfgold.me
- slave.nfgold.me
- *.nfgold.me
Currently without using HTTPS, I have the following configuration in my nginx:
server {
server_name *.nfgold.me;-
charset utf-8;
.....
}
And this works without fail.
I have used letsencrypt in a few of my projects but it does not seem to support wildcards?
I tried the following config and it does not work:
server {
server_name .nfgold.me;
rewrite ^ https://*.nfgold.me$request_uri? permanent;
}
server {
server_name .nfgold.me;
rewrite ^ https://*.nfgold.me$request_uri? permanent;
}
server {
listen 443;
server_name *.nfgold.me;-
charset utf-8;
ssl on;
ssl_certificate /etc/letsencrypt/live/nfgold.me/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nfgold.me/privkey.pem;
....
}
Is there an alternative for this?
While Let's Encrypt
does not give you wildcard certificates1 you can have a certificate with multiple subdomains. From their FAQ:And of course you can shop for a wildcard certificate elsewhere, i.e. many CA offer these.
1 Starting with 01/2018 you can also get wildcard certificates from Let's Encrypt