2026-02-06 21:14:52 +03:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-07 13:51:52 +03:00
|
|
|
# Модуль 1: Мониторинг (Flask, порт 5001)
|
|
|
|
|
location /api/ {
|
2026-02-06 21:14:52 +03:00
|
|
|
proxy_pass http://${OVP_API_HOST}:${OVP_API_PORT};
|
2026-02-07 13:51:52 +03:00
|
|
|
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;
|
2026-02-06 21:14:52 +03:00
|
|
|
}
|
|
|
|
|
|
2026-02-07 13:51:52 +03:00
|
|
|
# Модуль 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;
|
2026-02-06 21:14:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
location = /50x.html {
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
}
|
2026-02-07 13:51:52 +03:00
|
|
|
}
|