From 6e2c51aa35a6e8e5bff1499b8c52cfae170bda3e Mon Sep 17 00:00:00 2001 From: dmolinari Date: Thu, 20 Nov 2025 15:07:01 -0300 Subject: [PATCH] Fix Docker --- ChatbotApi/Program.cs | 2 +- proxy/nginx.conf | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChatbotApi/Program.cs b/ChatbotApi/Program.cs index 211cd3f..1d1eb2b 100644 --- a/ChatbotApi/Program.cs +++ b/ChatbotApi/Program.cs @@ -20,7 +20,7 @@ builder.Services.AddCors(options => options.AddPolicy(name: myAllowSpecificOrigins, policy => { - policy.WithOrigins("http://192.168.5.129:8081", "http://192.168.5.129:8082", "http://localhost:5173", "http://localhost:5174") + policy.WithOrigins("192.168.10.78", "http://192.168.5.129:8081", "http://192.168.5.129:8082", "http://localhost:5173", "http://localhost:5174") .AllowAnyHeader() .AllowAnyMethod(); }); diff --git a/proxy/nginx.conf b/proxy/nginx.conf index 9bb2d9a..f68655e 100644 --- a/proxy/nginx.conf +++ b/proxy/nginx.conf @@ -39,8 +39,18 @@ server { # 3. Servidor separado para el Panel de Administración server { - listen 81; # Puerto de escucha para el tráfico del panel de admin + listen 81; + # MISMA REGLA DE API + location /api/ { + proxy_pass http://api_server; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # El resto del tráfico va al frontend del admin location / { proxy_pass http://admin_server; proxy_set_header Host $host;