egg-http-proxy icon indicating copy to clipboard operation
egg-http-proxy copied to clipboard

代理匹配到了 为什么还会走路由 ?

Open shen-lan opened this issue 4 years ago • 0 comments

路由里有一条

router.get('/*', controller.tapd.staticMatch)
config.default.js

 config.httpProxy = {
    '/self': {
      target: 'https://api.xxxx.cn',
      pathRewrite: {
        '^/self': ''
      }
    }
  };  
plugin.js

  httpProxy: {
    enable: true,
    package: 'egg-http-proxy',
  } 

浏览器请求

http://127.0.0.1:7001/self/tasks/count?workspace_id=59395005

shen-lan avatar Nov 27 '20 11:11 shen-lan