fix: align api keepalive with gateway pool
This commit is contained in:
+3
-1
@@ -7,6 +7,7 @@ import { AppModule } from './app.module';
|
||||
import { MetricsService } from './metrics/metrics.service';
|
||||
import { OpenApiModule } from './open-api/open-api.module';
|
||||
import { configureHttpBodyParsers } from './http-body-limits';
|
||||
import { configureApiHttpServerTimeouts } from './http-server-timeouts';
|
||||
|
||||
Object.defineProperty(BigInt.prototype, 'toJSON', {
|
||||
configurable: true,
|
||||
@@ -43,7 +44,8 @@ async function bootstrap() {
|
||||
const port = Number(process.env.API_PORT ?? 3000);
|
||||
// 生产环境只允许 Nginx 访问管理 API;显式绑定回环,避免默认的全网卡监听绕过入口鉴权与限流。
|
||||
const host = process.env.API_HOST?.trim() || '127.0.0.1';
|
||||
await app.listen(port, host);
|
||||
const apiServer = await app.listen(port, host);
|
||||
configureApiHttpServerTimeouts(apiServer, process.env);
|
||||
|
||||
const metrics = app.get(MetricsService);
|
||||
const metricsHost = process.env.API_METRICS_HOST?.trim() || '127.0.0.1';
|
||||
|
||||
Reference in New Issue
Block a user