This is a script that based on a JSON file automates to offer a proxy server to several web pages, services or applications (as you could do with an Apache or Nginx server but simpler), connects to the Cloudflare CDN and manages the use of SSL certificates, updates the records for the domains/subdomains in Cloudflare belonging to the applications managed by the server and based on them redirects the requests.
A simple solution that allows you to have a server of multiple web services online and with https taking advantage of the free tier of the cloudflare CDN following this scheme. If you access the website christianvillegas.com, or any of its subdomains, you are already making use of this project.
graph LR
A[Client] <-- HTTPS --> B(CDN Node)
C[Client] <-- HTTPS --> D(CDN Node)
F[Client] <-- HTTPS --> G(CDN Node)
H[Client] <-- HTTPS --> I(CDN Node)
J[Client] <-- HTTPS --> K(CDN Node)
B <--> L((Cloudflare))
D <--> L
G <--> L
I <--> L
K <--> L
L <-- HTTPS --> N{CSSS}
N <-- HTTP --> M{{App 1}}
N <-- HTTP --> O{{App 2}}
N <-- HTTP --> P{{API 1}}
N <-- O.S. FS --> Q{{Static 1}}
N <-- O.S. FS --> R{{Static 2}}