Last time I talked about how to deploy your website on a CDN based platform at zeit.co.More info here:
However when everything was done, I ended up with a deployment address looks like this: sd.iiaku.now.sh
Then I replaced all of my asset with this prefix and my assets were returned as expected. I wanted to change this to a subdomain of my main website, this is what I have done yesterday.
First you'll have to create a CNAME record into your DNS zone of your domain:
This means cdn.simply-debrid.com will point out to sd.iiaku.now.sh.
Once this was done I only added an entry zone into my nginx configuration file in order to declare this new entry, bind it to the certs.
NB: I am using let'sencrypt for SSL management, basically certificates are initialy design for the main domain. Recently let'sencrypt added wilcard support meaning they will handle SSL for your main domain and subdomain *.youdomain.com.
So I just changed my certificates to a wildcard one:
You'll be asked to confirm challenge while adding a TXT RECORD for:
TXT acme-challenge.YOUR_DOMAIN with value from cli
Once the certs are ok, update your nginx accordingly.
Once this is done make sure you have now-cli installed, if not:
npm install -g now
Then to alias your subdomain the command is:
now alias https://YOUR_DOMAIN.now.sh you.subdomain
You'll have to make a TXT RECORD to confirm you own the domain.
Zeit will generate SSL for you an alias your domain to their url, then you'll be able to get your asset hosted on zeit.co but from your subdomain.
More info here: