trying to host a pages project at example.com/docs rather than the root
How would I go about doing this? I've been looking at origin rules but i don't see an option for changing the host header like the cloudflare docs say should be possible.
8 Replies
i don't really want to run a worker since this should be possible with origin rules
changing the host header in an origin rule requires an Enterprise plan
gotcha, this is not really that well documented
I could not find the limits anywhere lol
yeah ok i'm blind
š
i was always looking at https://developers.cloudflare.com/rules/origin-rules/features/
Cloudflare Docs
Available settings | Cloudflare Rules docs
The following sections describe the available settings in Origin Rules.
yeah
it should be on there as well, you can probably leave feedback about it with the š / š thing on the side or https://github.com/cloudflare/cloudflare-docs/issues/new/choose
So I threw a worker in front of it, but now I also want to cut off the pages.dev domain.
Is there a way I can make an internal request with a worker, or a way I can avoid rules that would otherwise redirect the pages.dev back to the canconical source of website.dev/docs
...gonna just use static assets i think lol
Workers which have static assets cannot be routed on a URL which has a path component.š got it to work, thanks erisa! The solution I've ended up with was converting my site to a workers static assets, because its entirely static, then throwing a second worker in front of it at the route i want everything to appear at then using service bindings so the static assets are never exposed publicly aside from through the subpathed router