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
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
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.