Not able to proxy to backend

I have a MERN app and im using a static and a web service. The static is bc1 and the web service is bc.

The frontend is vite and is set to proxy to the backend, but its still showing the call going to bc1

The builds show no error or issues for either one. I’ve included the vite config.

First time using render so I might be missing something here but it all seems like it should work.


export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/api': 'https://bc.onrender.com',
    },
  },
});

Hey,

Why do you need a proxy setup in this case? Couldn’t you call the backend directly? Or is your backend proxying requests to another service?

Make sure you’ve deployed the same code you’re referring to in your frontend service on Render. If the requests are being rerouted to your frontend unexpectedly, double-check for any hardcoded strings in your code. Also, ensure you’re running the same frontend version locally and verify if it behaves the same way. This should help narrow down the issue.

I didn’t want to have to go in and change all the calls. I ended up just doing rewrites. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.