From 3cd7db11e77953556be9bfda5254d98c06c6564c Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Fri, 20 Mar 2026 23:27:06 +0200 Subject: [PATCH] kin: BATON-006-frontend_dev --- nginx/baton.conf | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/nginx/baton.conf b/nginx/baton.conf index e1e1854..c9d892a 100644 --- a/nginx/baton.conf +++ b/nginx/baton.conf @@ -55,16 +55,32 @@ server { # Заголовки X-Telegram-Bot-Api-Secret-Token НЕ логируются — # они передаются только в proxy_pass и не попадают в access_log. - location / { + + # API → FastAPI + location /api/ { proxy_pass http://127.0.0.1:8000; 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; - # Таймауты для webhook-запросов от Telegram proxy_read_timeout 30s; proxy_send_timeout 30s; proxy_connect_timeout 5s; } + + # Health → FastAPI + location /health { + proxy_pass http://127.0.0.1:8000; + 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; + } + + # Статика фронтенда (SPA) + location / { + root /opt/baton/frontend; + try_files $uri /index.html; + } }