Hi Netlify Support,
I’m using Netlify DNS and have a wildcard CNAME record that points to prod branch site.
*.mydomain.app -> myapp.netlify.app
I also have a subdomain called test that points to my test branch site
test.mydomain.app -> test–myapp.netlify.app
In Deploy context, my production branch is prod and I also created branch deploys for my test branch as well.
prod -> myapp.netlify.app
test -> test–myapp.netlify.app
I was hoping test.mydomain.app would use the build/deploy of test–myapp.netlify.app site. Instead, it seems to pick up the build of myapp.netlify.app site.
This I can confirm, because the API environment variable (in my app source code) I set the value to api.myapi.com for production build (myapp.netlify.app). Whereas the same variable is set to api-test.myapi.com for test build (test–myapp.netlify.app)
UPDATE: If I visit test–myapp.netlify.app directly, I can see that it is using the correct API environment variable (api-test.myapi.com). Seems like the wildcard CNAME is taking precedence over explicit subdomain test.
So the issue is my branch subdomain test.myapp.app is not pointing to the right API server.
Can you please help with what is missing here?