3 ms·
The author mentions Cloudflare as having the ability to rewrite requests from `api.website.com/*` to `website.com/api/*`. Is that functionality available as a p
by eins1234 5y ago
The author mentions Cloudflare as having the ability to rewrite requests from `api.website.com/*` to `website.com/api/*`. Is that functionality available as a page rule or would we have to use workers and pay for every request rewritten?
I remember taking a look at this a while ago and only found ways to do this through workers, so was turned off by the potential cost scaling. Ended up just setting a high `Access-Control-Max-Age` and calling it a day. But maybe I've missed a more cost effective way to accomplish this?
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- gnfargbl 5y agoI also can't find a way to do this with page or transform rules. Trying to create a rule which modifies the Host header is met with an error message. Apparently only Enterprise customers can do this [1] [2]. [1] https://support.cloudflare.com/hc/en-us/articles/206652947-Using-Page-Rules-to-Re-Write-Host-Headers https://support.cloudflare.com/hc/en-us/articles/206652947-U... [2] https://community.cloudflare.com/t/rewrite-host-header-in-page-rule/143639 https://community.cloudflare.com/t/rewrite-host-header-in-pa...
- eins1234 5y agoAh yes that has been the story of my life on Cloudflare. Anything remotely interesting is gated behind what I can only assume is a thousands of dollars per month Enterprise plan.