Our web app gives each user a sub-domain. I'd like to offer some larger plans CNAME's so they can point one of their own domain names with a CNAME to their sub-domain on our server
ie; username.ourwebapp.com
customersdomain.com => CNAME username.ourwebapp.com
Our NGINX server is configured with wild card sub-domains, but uses a perl conf to read valid sub-domains from a file. If the sub-domain doesn't exist they get a 404.
So I am guess to allow users to create CNAME's to their sub-domain on our server we will need to create a name based virtual host and a new config file in sites-available include their subdomain on our server, as well as an alias of the customers own domain? Is that how it should be done or is there another way?
Thanks