I want to redirect traffic from an offline site to another url.
Example,
I have a rest api site that is: api.somedomain.com:1234
With no routes, I return a “status” - “ok”
However, when the rest api service is not running or if the server is down, anything but 200 code, I want to redirect it to: api-fallback.somedomain.com
If it’s not Port 443, it might be difficult to do this. Only the following ports may be Proxied through Cloudflare unless you’re on an Enterprise Plan with Spectrum:
Yes, this is only for testing purposes. But I would just like to figure out if im able to do a fallback server, unless I use an api on top of it. Check if api.somedomain.com is online then point to it. If not, point to api-fallback.somedomain.com
Another approach would be to script this on a separate server. Do your checks, and if it fails, use the API to make a DNS change. This would be completely independent of its / proxy status.