Domain name wildcard option in NGINX configuration

ScotGram scotgram at scotgram.com
Wed Apr 18 17:51:41 UTC 2018


Hello,

We have created a Nginx configuration which with multiple cnames and the 
same domain name, and it is working correctly  but we want to be able to 
wildcard the domain name so during our system configuration we do not 
have to modify the nginx configuration for different domains we are 
hosting.

What we want is to replace the

server {
server_name cname1.domainname.com ...
}
server {
server_anem cname2.domainname.com
}

----->
with

server {
server_name cname1.*.com
}

server{
server_name cname2.*.com
}

The associated SSL keys would still be in the SSL directoy, but would 
also need to specify a * in the file name

Thanks
ScotGram


More information about the nginx mailing list