Google App Engine Domain Mapping Issue Through CNAME

78 Views Asked by At

I have my base app hosted in GCP App Engine. The base domain for this app is app.xyz.com

I have user based subdomain dashboard access.

Eg. User 1 can have their subdomain xyz.pqr.com and then map it to my base domain app.xyz.com

User 2 can have their subdomain example2.com and then map it to my base domain app.xyz.com

I want the mapping to be done through CNAME only. i.e User have to change the cname to map with my base domain.

However while visiting these subdomain its landing me to google 404 page.

I want App engine to serve content to my base domain and all domain mapped to it.

In app engine, I have added *.xyz.com as domain mapping with traffic proxied through cloudflare using origin server ssl certificate.

Currently i can access the app through any subdomain like v1.xyz.com or v2.xyz.com buy not through v1.abc.com Which is currently mapped to app.xyz.com through cname

enter image description here

current ssl settings for Cloudflare in Full mode

2

There are 2 best solutions below

0
Bijay Nayak On BEST ANSWER

Finally fixed it using a https load balancer:

Backend -> App Engine Instance Frontend -> app.xyz.com

v1.abc.com -> app.xyz.com via CNAME

1
NoCommandLine On

v1.abc.com isn't actually mapped yet to app.xyz.com.

What you've done is essentially to say - if you're looking for v1.abc.com, talk to Google's servers.

Now, you have to tell Google's servers - when you receive traffic from v1.abc.com, you should serve up the App at appId (your App Id). This means you have to add a mapping from v1.abc.com on your GAE custom domains tab.

Simply put - to build a service where users can map their custom domains to your AppId, you have to add a mapping for each user's custom domain