From c2c516248e67f9da7c4c50c5784f9152b04eeaee Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Wed, 25 Jun 2025 15:26:40 -0500 Subject: [PATCH] Fix: Add trust proxy setting for Caddy reverse proxy - Added app.set('trust proxy', true) to backend configuration - Resolves rate limiting errors when behind Caddy reverse proxy - Fixes document upload failures caused by X-Forwarded-For header issues --- backend/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/index.ts b/backend/src/index.ts index 4383c532..c057419b 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -23,6 +23,9 @@ dotenv.config(); const app = express(); const PORT = process.env.PORT || 3001; +// Trust proxy when behind reverse proxy (Caddy) +app.set('trust proxy', true); + // Initialize Prisma client export const prisma = new PrismaClient({ log: ['query', 'info', 'warn', 'error'],