I have a some compute service code with a backend with a host override - let’s say both the domain and the override are foo.example.com. I can see from some logging that when I make the fetch in the compute code x-forwarded-host is set to something else (say cdn-foo.example.com), but at origin it appears that both the headers host and x-forwarded-host are foo.example.com. I was expecting that the x-forwarded-host header would be preserved?
Are you saying that X-Forwarded-Host
was a header in the incoming request, and you’re expecting it to be preserved as the request is sent to your backend?
We have a documentation page covering this header, but unfortunately it only addresses Delivery (VCL) services, not Compute services.
I can see from my logging that it’s in the call to fetch, so I think I was expecting that it would make its way through to origin but (unless I’m mistaken) it seems that’s not so.
Unfortunately we don’t have any documentation to rely on here which would give us a definitive statement about what to expect in the Compute platform. If you need this header to be forwarded along to the backend, please open a support ticket so it can be forwarded to the engineering team and prioritized.