防护:添加人数过多防护措施
This commit is contained in:
@@ -18,7 +18,7 @@ export default (appInfo: EggAppInfo) => {
|
||||
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
|
||||
};
|
||||
// add your egg config in here
|
||||
config.middleware = [ 'parmsDecode', 'getIp' ];
|
||||
config.middleware = [ 'parmsDecode', 'getIp', 'proxy' ];
|
||||
|
||||
config.mongoose = {
|
||||
url: 'mongodb://dbop:zyzdbopbantu@dds-8vbdb47c6fb58a541.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbdb47c6fb58a542.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-500808098', // 内网
|
||||
@@ -75,6 +75,31 @@ export default (appInfo: EggAppInfo) => {
|
||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||
};
|
||||
|
||||
|
||||
let regions = [ // 大区数据
|
||||
{ env: 'stable', name: "常山少年", domain: 'http://zyz_gm.trgame.cn' },
|
||||
{ env: 'alpha', name: "测试服", domain: 'http://pinus_gm_test.trgame.cn' },
|
||||
{ env: 'dev', name: "开发服", domain: 'http://zyzdev_gm.trgame.cn' },
|
||||
// 37测试服组
|
||||
{ env: 'sq1', name: "37测试1服", domain: 'http://gm-sgzyz.37wan.com' },
|
||||
];
|
||||
config.regions = regions;
|
||||
|
||||
let httpProxy: any = {};
|
||||
for(let { env, domain } of regions) {
|
||||
|
||||
httpProxy[`/web/${env}/`] = {
|
||||
target: domain,
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
pathRewrite: function(path) {
|
||||
console.log('proxy', path, path.replace(`/web/${env}/`, '/web/'))
|
||||
return path.replace(`/web/${env}/`, '/web/')
|
||||
}
|
||||
}
|
||||
}
|
||||
config.proxy = httpProxy;
|
||||
|
||||
// the return config will combines to EggAppConfig
|
||||
return {
|
||||
...config,
|
||||
|
||||
Reference in New Issue
Block a user