Proxy error: Could not proxy request [How to Solve]

After the Vue project is started, the login reports the following error:

There is a problem with the proxy server. It may be that the currently configured proxy server is closed or incorrectly configured. In vue.config.js file, change the target to the correct opened server address (you can ask the back-end developer to start the server)

proxy: {
  // Proxy server settings
  '/my_test_proxy': {
    target: 'xxx:xxx', // Need to proxy the current address to target
    changeOrigin: true,
    pathRewrite: {
      ['^' + '/my_test_proxy']: '' // rewrite '/my_test_proxy' to ''
    }
  }
}

Similar Posts: