Totally unexplainable! Need help!

I have my test deployment with netlify domain name https://test-aws--snarkify-cloud.netlify.app which correctly points to our test backend API at test.api.snarkify.io which is an env var configured through the web UI.

However, when I visit my customized domain name test.console.snarkify.io which has a CNAME record pointing to test-aws–snarkify-cloud.netlify.app, the backend API it was trying to access become our production configuration (api.snarkify.io). This is totally beyond my comprehension, how is it even possible that the same server will pick up different env vars when accessed from different domain names?

Can someone help me figure out how this could be fixed?

It probably isn’t.

I’d imagine that test.console.snarkify.io for whatever reason isn’t actually the same thing as https://test-aws--snarkify-cloud.netlify.app

However since you’re using next.js, and if SSR could be involved, as far as I’m concerned “almost anything might be happening”. Checking the source of the site when accessed by the two URLs, (and hoping that they’re at least somewhat static or representative of a unique build), it shows different build id’s and hashes on the various files.

test.console.snarkify.io

test-aws--snarkify-cloud.netlify.app

Thanks for your prompt response!

I just verified that the build id of test.console.snarkify.io is exactly the same as our production version.

I’m not a FE so I want to make sure I understand your points correctly. Does it mean that next.js is doing some magic that results in the difference? And it potentially leads me to the production build?

I may not be either, I don’t know what you’re referring to when you say FE.

I have no idea, I personally do not use Next.

My only point is that they don’t appear to be resolving to the same thing like I would expect.

You could double check how you have the DNS configured to ensure it isn’t inadvertently resolving to somewhere else.

If that actually is all correct, then I would expect it to be something Next related.

By FE, I mean frontend engineer, sorry for using less well known abbreviations.

After digging more into the configurations, I think I found the root cause. The domain name test.console.snarkify.io has been added to the Production domains in the domain name configuration tab. After removing it I think it’s now resolved to the right service, only with some certificate issue to fix. But that’s another story.

Thanks anyway!

I’d presumed you may have meant frontend engineer, but couldn’t fathom how any of this relates to frontend.

It’s great to know that a Totally unexplainable issue was actually perfectly explainable.