使用 proxy报错
Error occurred while trying to proxy request
node 版本 10+
代码
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use(
proxy('/api', {
target: 'http://xxx.xxx.xx.xxx:8080',
pathRewrite: { '^/api': '' },
secure:false
})
);
};
排查了好久
解决办法 https://github.com/chimurai/http-proxy-middleware/issues/171#issuecomment-439020716
找问题还是去issue找的快呀
网友评论