代理一直在工作,直到我更新了pc上的节点js,所以我不能再启动了。
我的代理配置如下:
devServer: {
contentBase: './dist',
hot: true,
proxy: {
'/api': {
target: 'https://localhost:8443/test',
pathRewrite: { '^/api': '' }, secure: false, // had an expression which was resolving to true
changeOrigin: true,
headers: {
"Connection": "keep-alive"
},
}
}
}
当我删除secure: false时,错误就来了。但是当我有了标签(secure: false)时,我没有收到任何错误,但是我的应用程序一直在调用localhost:8080而不是https://localhost:8443/test
到目前为止,我尝试删除了nodes_module和包-lock.js,也删除了缓存,然后再次安装了npm install和npm update,但没有结果,我还尝试了127.0.0.1而不是localhost
发布于 2021-11-25 11:50:52
PRoblem在IIS我的后端在那里没有为端点https://localhost:8443/test正确配置
所以我没有得到正确的错误,只是我在浏览器中看到调用了错误的linke。
修复方法是在iss中正确配置https://localhost:8443/test
https://stackoverflow.com/questions/70109153
复制相似问题