How to tell if a subdomain is down?

Using "FILE" on bare metal. Not using containers of any kind - yet.

I will be creating dynamic files on the fly "turning on" subdomains. I have found the Error middleware but it looks like that is for a already configured routes. If the subdomain hasn't been create and no dynamic file as been created, then the user gets a 404 error. I would like to catch that error and try to start or restart that subdomain.

so.... has its own dynamic file... game1.toml. This gets created when the user "starts" his game server. When the user is done, and stops the game, then the file gets deleted. This is all good and working.

Now i would like it to catch when the game server is stopped (no file created) and poke a webhook to get the controller to start the game server and create the game1.toml file.

I know you are going to say... just use docker! I am working my way there. Learning one technology at a time. First let me get Traefik to work and understand how to configure it.

thanks for any help or advice.


p.s. You might ask, why not leave it running all the time. It is about resource management. The server will only get used for 4-6 hours every other week at random times. No point leaving it running.