limzykenneth
limzykenneth
CDCloudflare Developers
Created by limzykenneth on 7/24/2024 in #pages-help
Domain fronting with Cloudflare Pages
I'm trying to replace one part of an existing website (hosted more traditionally) with a Cloudflare Pages site that has functions support as well, the functions are existing workers code I already have in deployment. From what I can see the recommended way to also serve static site with workers code is to transition it to pages but I'm finding some problems with it. Specifically my current worker is using routes (https://developers.cloudflare.com/workers/configuration/routing/routes/) to only run on specific paths and sometimes also pass through the request to the origin as necessary. I don't see both triggering on specific paths and passing to the origin being possible with Cloudflare Pages and Functions (custom domains only supports DNS records it seems and no pass through is documented to be possible). Essentially POST https://example.com/foo currently goes to the worker first then either get processed there and returned or forwarded to the origin to respond, I want to keep this behaviour. At the same time I want to add GET https://example.com/bar to serve a static page from Cloudflare Pages while GET https://example.com will still go through to my origin. I hope that is clear. What are my options here?
23 replies