账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    gulp配置时使用http-proxy-middleware做代理,配置多重代理出错?
    63
    0

    gulp.task('server', function () {
    connect.server({

    root: ['www'],
    port: 8081,
    fallback: 'www/index.html',
    host: '0.0.0.0',
    livereload: true,
    middleware: function(connect, opt) {
      return [
        proxy('/api',{
            target: 'http://api.app1101815945.twsapp.com/',
            changeOrigin:true,
            pathRewrite: {'^/api': '/test-server-api/index.php?'}
        }),
        proxy('/apitwo',{
            target: 'http://test.api.mall.serve.com/',
            changeOrigin:true,
            pathRewrite: {'^/apitwo': ''}
        })
      ];
    }

    });
    });
    我配置一个域名是正常的,配置两个,用第二个去请求的时候就会报404?我司的后台是PHP写的,是不是后台也要做什么配置?我就算配置一个,在本地浏览器运行请求正常,上了测试服务器也会报错,有大神知道原因么

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 简以时光 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部