Can you forward certain requests from a Cloudflare Pages site to a different domain?

Hello! I'm looking to see if I could deploy a site using PayloadCMS with Cloudflare Pages. They have a backend accessible through routes starting with
/api
.

Could I host my static frontend on Cloudfare Pages, but forward (or perhaps "transform" is the right word) all requests to
/api
to a server I would host elsewhere?

In order to get cookies to work correctly, the site would have to appear to the web browser like it was on the same domain. 😕

Thanks for your help!
Was this page helpful?