How to determine which custom hostname is being requested?

If I am using Cloudflare for SaaS where I have an arbitrary number of clients using custom hostnames, how do I determine on the client what is being requested?

For instance, if the fallback URL is a wild carded “customers.example.com” and there are 2 customers, where one is using a custom hostname, how do I determine what is being requested?

URL requested for customer 1 (no custom hostname): customer1.customers.example.com
URL requested for customer 2 (with custom hostname): foo.bar.com

What is passed on to the origin in terms of headers? Both of these requests go to customers.example.com, so how do I determine which customer the request is on behalf of?

Use the host header

1 Like