From efd249810df6555ed27460914a740bc6d39c00b4 Mon Sep 17 00:00:00 2001 From: Collina Systems Date: Sat, 4 Jul 2026 17:31:28 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20trustProxy=20=E2=80=94=20la=20IP=20real?= =?UTF-8?q?=20del=20cliente=20llega=20v=C3=ADa=20nginx=20(rate=20limit=20p?= =?UTF-8?q?or=20IP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/index.js b/backend/src/index.js index c285505..34ce450 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -8,6 +8,10 @@ import { runMigrations, seedSupervisora } from './db/migrate.js'; import authRoutes from './routes/auth.js'; const fastify = Fastify({ + // node vive detrás del nginx del propio container (y de Traefik en prod): + // sin esto req.ip sería siempre 127.0.0.1 y el rate limit del login + // compartiría un solo bucket para todos los clientes. + trustProxy: true, logger: { level: config.logLevel, ...(config.nodeEnv === 'development' && {