From f8381bcdccfa644ad3993b6bbd3b0f68312b69be Mon Sep 17 00:00:00 2001 From: Karun Agarwal <113603846+singhalkarun@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:10:50 +0530 Subject: [PATCH] Trust Proxy Syntax Fix --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 2d2fc01..0d51964 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,7 @@ import helmet from 'helmet'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.getHttpAdapter().getInstance().set('etag', false); + app.getHttpAdapter().getInstance().set('trust proxy', 1); const config = new DocumentBuilder() .setTitle('e-Samwad User Service') @@ -19,7 +20,6 @@ async function bootstrap() { SwaggerModule.setup('swagger', app, document); // add security headers app.use(helmet()); - app.set('trust proxy', 1); // enable cors app.enableCors({