Can Cloudflare map a subfolder like example.com/support to a different domain or subdomain like support.example.com or even a third party domain? I.e., can you define any custom reverse proxy rules?
This is possible within Azure Frontdoor but I can’t see that cloudflare has any similar function?
Thanks. I’m not getting far with the workers approach. Why is this code invalid (it deliberately has no effect):
async function handleRequest(request) {
// My code will go here
return fetch(request)
}
addEventListener("fetch", async event => {
event.respondWith(handleRequest(event.request))
})
If you did not assign this worker to any route that had an origin behind it, then you simply did not respond to these requests with anything. If you assign this worker to a working route with an origin behind it, it will work and will not yield any errors.
Having said this, hello world is a much better place to start such tests:
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
return new Response('hello world', {status: 200})
}