Error occurred while trying to p

2019-07-17  本文已影响0人  evilGenuis_9527

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

上一篇 下一篇

猜你喜欢

热点阅读