Hello,
I am looking for some input as I just recently started using Traefik.
Current Situation
At the moment, I using docker compose to run a simple NextJS application with Traefik as a reverse proxy. Port 80 redirects to port 443 which uses Let's Encrypt.
Task
I am planning a white label feature so that customers can resell the same service using their own domain. The current idea is:
- Every customer automatically gets assigned a subdomain (based on username, id, ...).
- They would then be asked to name their own domain.
- Instructions to create a CNAME record for said domain pointing to the assigned subdomain would follow.
- Once the record has propagated, I would create a Let's Encrypt certificate for their domain.
Idea
What's the best way to automate said task? My current idea is:
- Add another NodeJS service which reads the assigned subdomains and respective customer domains from the database.
- Ignore domains which do not yet ping to my server.
- In Docker, I would then share the traefik.yml configuration file with said service and update it on the fly.
Questions
- Is there a better way to achieve said task?
- Once I have updated the traefik.yml, what's the best way to instruct the Traefik container to reload the configuration?
Any input is appreciated, thanks.