diff --git a/backend/src/main.ts b/backend/src/main.ts index 3e892ce..0416fb5 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,6 +1,7 @@ import { Logger, ValidationPipe } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import { NestFactory } from "@nestjs/core"; +import { NestExpressApplication } from "@nestjs/platform-express"; import * as Sentry from "@sentry/nestjs"; import { nodeProfilingIntegration } from "@sentry/profiling-node"; import helmet from "helmet"; @@ -8,10 +9,13 @@ import { AppModule } from "./app.module"; import { AllExceptionsFilter } from "./common/filters/http-exception.filter"; async function bootstrap() { - const app = await NestFactory.create(AppModule); + const app = await NestFactory.create(AppModule); const configService = app.get(ConfigService); const logger = new Logger("Bootstrap"); + // Activer trust proxy pour récupérer l'IP réelle derrière un reverse proxy + app.set("trust proxy", true); + const sentryDsn = configService.get("SENTRY_DSN"); if (sentryDsn) { Sentry.init({