on my site, I have setup a netlify.toml file in the root of my nuxt 3 project and have included the following contents:
[[redirects]]
from = "/proxy/*"
to = "https://api.mysite.com/:splat"
status = 200
force = true
In the build log, it does state that three redirects are processed, however when I view the build files, I only see the two default netlify redirects:
/__nuxt_error /.netlify/functions/server 200
/* /.netlify/functions/server 200
I’m not sure what I’m doing wrong or why this redirect is not being placed into the build. I did view the debugging guide here: [Support Guide] Making redirects work for you - troubleshooting and debugging
However, it didn’t really apply since the netlify dashboard shows three rules processed, even though only two are being placed in the redirects file.
EDIT
I have now manually included a _redirects
file in my /public
dir to ensure that it gets generated:
/__nuxt_error /.netlify/functions/server 200
/* /.netlify/functions/server 200
/proxy/* https://api.mysite.com/:splat 200!
But the proxy still does not function.
For example, navigating to my api: https://api.mysite.com/news
returns a list of news
However: https://main--mysite.netlify.app/proxy/news
just returns a 405 error.