Api redirects going to unknown url: https://proapi.azurewebsites.net//api/me

Hi everyone
Got a weird one,

My Reactjs SPA makes calls to an API - I use netifly’s redirect to route requests from /api/* to the api endpoint

This suddenly stoped working today for the site mentioned above.
The weird part is it works for another site I have with the same redirect logic.

Inspecting my site in the networks tab, it looks to be trying to make calls to:
https://proapi.azurewebsites.net//api/me
Instead of my api, The azurewebsites.net is completely unknown to me, it must be coming from Netifly’s side?

I can see that the 2 redirect rules below are picked up from the build logs
I use string interpolation with the build command to populate the API_URL

Site: http://ysft-staging.projectyusoft.com

Build Command:
sed -i s/API_URL/${API_URL}/g netlify.toml && npm run build
where API_URL is an environment variable

TOML file:

[[redirects]]
  from = "/api/*"
  to = "http://API_URL/api/:splat"
  status = 200
  force = true

[[redirects]]
  from = "/*"
  to = "index.html"
  status = 200
  force = true

Any help would be greatly appreciated!

Update:

Building and deploying locally seems to work - the redirects route fine

When I push the exact same build to a preview branch I see the issue again
I tried a _redirects file instead of a TOML and that has the same issue

This is perplexing

Bump, this is currently a complete blocker for us, would really appreciate some help

hey @dozer23 - sorry it is taking us a while to respond.

This is a very strange issue. I can tell you that there is nothing on Netlify’s side that should automatically forward anything to that URL - that is not something we do.

I am wondering if some kind of hijack is happening here some how?

I realize you are talking about a redirect, but is there any possibility your site is being interfered with? Not sure I have a better answer for you at the moment.