美文网首页
Error occurred while trying to p

Error occurred while trying to p

作者: evilGenuis_9527 | 来源:发表于2019-07-17 19:09 被阅读0次

使用 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找的快呀

相关文章

网友评论

      本文标题:Error occurred while trying to p

      本文链接:https://www.haomeiwen.com/subject/ydiclctx.html