We are currently looking into moving a few Static Website over to Cloudflare Workers but are lacking some information on what we can do in terms of Redirect/Rewrite/Proxy at the Edge.
Our situation is that we are soon to launch a new website that will take over most URL/Content from a old one. The new one is built on JAMstack, while the old one is a .php site. As we will need to serve content from both sites for sometime until everything is built we need to be able to proxy request to the old one when coming into CF for URLs that does not match anything hosted on the Workers.
Netlify does this rather simple with a 1-liner as it keeps track of what it serves, and for anything it can’t match it tries to match whatever ruleset you have setup (Rewrite, Redirect, Proxy).
Is this something that Workers Sites can achieve?
- Does the content exist at Workers Sites?
If yes, serve content, else proceed with Rewrite/Redirect Rules
If no match is found in the Rewrite/Redirect Rules, then try and proxy the content from outside Workers.