@@ -20,6 +20,11 @@ class APP {
}
setupMiddleware() {
// 服务在 nginx 之后,需信任代理头才能拿到真实客户端 IP
// (否则 ctx.ip 恒为 127.0.0.1,限流会变成全站共享一个桶)
this.app.proxy = true;
this.app.proxyIpHeader = "X-Real-IP";
this.app.use(cors());
this.app.use(bodyParser());
The note is not visible to the blocked user.