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写的,是不是后台也要做什么配置?我就算配置一个,在本地浏览器运行请求正常,上了测试服务器也会报错,有大神知道原因么