Can I rely on the 'x-forwarded-host' request header?

I'm using Cloudflare and Cloudflare Tunnel. I'd like to get the current domain/host in my app by looking at the request headers. It seems 'x-forwarded-host' (together with 'x-forwarded-proto') is the defacto standard. However, nowhere in the documentation I can read anything about this header, even though it seems to be set. Can I rely on this header being available and correct? Or should I just stick to the 'Host' header?

Thank you 🙂
Was this page helpful?