4 ms·
Just as a side-note since their example uses CloudFlare: I think that host-rewriting is disabled on CloudFlare as a security or spam-avoidance feature. If you
by thitcanh 5y ago
Just as a side-note since their example uses CloudFlare: I think that host-rewriting is disabled on CloudFlare as a security or spam-avoidance feature.
If you want to have CF change the host to something else, like censored.com, this domain must also be part of your controlled domains, which means CF can’t be used for this purpose.
This at least was the case last time I looked into this (12 months ago)
It’s also possible that this feature is enabled for paying users, which I wasn’t.
- luckylion 5y agoYou can do it with a Worker, it'll do completely independent requests to the backend and you can then rewrite them (e.g. change headers, content) and relay them to the client.
- VWWHFSfQ 5y agoI found this to be the case on CloudFront as well. As far as I can tell, it's not possible to direct the request to a different, custom origin based on the Host header. Only the URL path. The recommendation is to use a Lambda@Edge worker to do it. I find this very annoying.
- bastawhiz 5y agoI did just this, to create a version of Github with scrambled text. https://guthib.mattbasta.workers.dev/ https://guthib.mattbasta.workers.dev/
- futhey 5y agoSome low-cost CDNs allow this, like BelugaCDN and BunnyCDN, probably others, with a web GUI for setup.