Replicate secure cdn using a normal cdn as fallback
1- Install http-server nodejs module
sudo npm install -g http-server
2- Create a folder for your files
mkdir replicated-cdn
cd replicated-cdn
3- Create a self-signed certificate
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
4- Add the secure cdn host in your /etc/hosts
127.0.0.1 scdn.example.com
5- Launch the local server
http-server --ssl -p 443 --cors --proxy http://cdn.example.com/
On MacOS you probably need to use sudo
If the request cannot be resolved, it will try to load the files from http://cdn.example.com/
If you create the necessary files, it will load your filel :)
Based on this article: https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server