Proxy error: Could not proxy request /login from localhost:8090 to http://:8089. See https://nodejs.

本文档介绍了在Vue项目中遇到的Proxy错误:'ENOTFOUND',并提供了检查和修改vue.config.js文件中target配置的解决方案。通过将目标地址设置为'http://localhost:8089',并启用changeOrigin和secure选项,可以确保API请求正确代理到指定服务器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Proxy error: Could not proxy request /login from localhost:8090 to http://:8089.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ENOTFOUND).

检查vue.config.js文件
修改target:标签

  devServer: {
    port: 8090,
    // host: '192.168.1.101',
    https: false,
    hotOnly: false,
    proxy: {
      '/api': {
        // login-Post地址
        target: 'http://localhost:8089',
        changeOrigin: true,
        secure: false,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
后端分离教Proxy error: Could not proxy request /session from localhost:8082 to http://localhost:8080/springboote6kq8g83/. Proxy error: Could not proxy request /session from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /news/list?page=1&limit=6&sort=addtime&order=desc from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /session from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /session from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /news/list?page=1&limit=6&sort=addtime&order=desc from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /session from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). Proxy error: Could not proxy request /users/login?username=admin&password=admin from localhost:8082 to http://localhost:8080/springboote6kq8g83/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED). 错误出现在哪里 如何就解决 请一步一步告诉我 程
最新发布
03-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小巫医初春

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值