profiler module moved from static config to environment dpendent config

This commit is contained in:
Антон
2026-02-07 13:51:52 +03:00
parent 5260e45bd8
commit 4bd4127bb5
8 changed files with 88 additions and 49 deletions

View File

@@ -9,21 +9,29 @@ server {
try_files $uri $uri/ /index.html;
}
# Proxy API requests
location /api/v1/ {
proxy_pass http://${OVP_API_HOST}:${OVP_API_PORT};
}
location /api/auth {
# Модуль 1: Мониторинг (Flask, порт 5001)
location /api/ {
proxy_pass http://${OVP_API_HOST}:${OVP_API_PORT};
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_pass_header Authorization;
}
location /api/ {
proxy_pass http://${OVP_PROFILER_HOST}:${OVP_PROFILER_PORT};
# Модуль 2: Управление профилями (FastAPI, порт 8000)
# Мы проксируем /profiles-api/ на внутренний /api/ внутри FastAPI
location /profiles-api/ {
proxy_pass http://${OVP_PROFILER_HOST}:${OVP_PROFILER_PORT}/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Для корректной работы OpenAPI/Docs за заголовком
proxy_set_header X-Forwarded-Prefix /profiles-api;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}