Hi
We want to migrate our site from on-prem to Vercel. For most of the domains, this was straight forward and worked well. But for the site targeting customers in China Mainland it gets a bit tricky as we need to route the traffic through servers which do have a license to operate in China Mainland - we use the Alibaba CDN for this.
Current Architecture
Our current setup (on-prem origin / Vercel not involved) looks like this:
site.cn
↓
Alibaba CDN
↓
cn.site.com (while preserving the host header: Host: site.cn)
↓
origin server (on-prem)
So users in China Mainland visit site.cn which is pointing to Alibaba which is then requesting the actual content from our origin servers at cn.site.com but preserve the Host header, so the origin renders the site as running under site.cn (important!)
Proposed Vercel Setup
The setup with Vercel should look something like this:
site.cn
↓
Alibaba CDN
↓
cn.site.com (while preserving the host header: Host: site.cn)
↓
Vercel
↓
Our-Vercel-Project (Configured Domains: cn.site.com, site.cn)
Problems Encountered
When we now want to migrate this setup to Vercel, several problems occur:
- We can change the DNS record of
cn.site.comto point to Vercel but since theHostheader of the requests sent by the Alibaba CDN is set tosite.cn, Vercel will not be able to map them to the correct project. - If we also configure
site.cnas a domain for the Vercel project, it will not work because the DNS record for this domain does not point to Vercel but Alibaba. Therefore Vercel will state a misconfigured domain and will not map requests with the respectiveHostheader to this project (and we will also not have a valid certificate). - If we do not preserve the
Hostheader on the Alibaba requests (sendingHost: cn.site.comin the requests to Vercel), the requests will end up on our project in Vercel but it will run in the wrong context ofcn.site.cominstead ofsite.cnand therefore render wrong content (e.g. URLs pointing tocn.site.cominstead ofsite.cn).
I guess this is quite a common problem / setup for sites also serving users in China Mainland so we are surely not the first ones facing this issue. How is this usually solved? I expected that I could add some TXT record to the site.cn DNS entry to verify domain ownership to Vercel (e.g. TXT _vercel.site.cn = vc-domain-verify=abc123) but this seems to be only used to transfer domain ownership between Vercel accounts.
We do have full control over the DNS records but they are not managed via Vercel but a 3rd party provider.
Any help is appreciated!
Thanks, Peter