Redirects going to localhost and not expected url

Hello,

I’m struggling a bit with my Remix app and redirects. Essentially, what I’m trying to is make POST request to a server that does not have a SSL and am trying to utilize redirects to be able to reach the server.

I’ve added the following to my netlify.toml file (i’ve put a placeholder in for the server I’m trying to reach.)

[[redirects]]
from = “/*”
to = “/.netlify/functions/server”
status = 200

[[redirects]]
force = true
from = “/api/*”
to = “http:/sample-url.com/:splat”
status = 200
conditions = {Method = [“POST”]}

I’ve validated with https://redirects-playground.netlify.app/ and it seems to pass.

However, this fails as I keep getting 404 errors. It looks like it’s looking for localhost:80/api and not the proxied url. Anyone have any ideas where I’m failing? I’m using axios to fetch data and a sample url would look like: /api/my-endpoint.

Any ideas?

If this is what you’ve in your config, then you’re missing an /. It should be http:// and not http:/.

If that’s not it, please share your site name.