From 1914e4d25e86f79f43a55983ed2e44e45103adc5 Mon Sep 17 00:00:00 2001 From: hogweed1 Date: Mon, 2 Nov 2026 18:59:58 +1000 Subject: [PATCH] well, --- files/angie/lb1.guaranteedstruggle.host.conf | 41 +++++++------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/files/angie/lb1.guaranteedstruggle.host.conf b/files/angie/lb1.guaranteedstruggle.host.conf index ae16475..0db6881 100644 --- a/files/angie/lb1.guaranteedstruggle.host.conf +++ b/files/angie/lb1.guaranteedstruggle.host.conf @@ -434,7 +434,7 @@ server { upstream ceph_dashboard_backend { # КРИТИЧНО ДЛЯ ANGULAR: Каждый клиент работает строго со своей нодой! ip_hash; - + # Сюда прописываем те ноды, где у вас запущены и могут быть активны ceph-mgr # Порт HTTP 8080 (как мы настроили в самом начале) server 192.168.0.71:8080 max_fails=3 fail_timeout=10s; @@ -466,35 +466,22 @@ server { location / { proxy_pass http://ceph_dashboard_backend; + + #=================================================================== + # РАЗРЫВАЕМ ПЕТЛЮ РЕДИРЕКТОВ: Полностью отключаем авто-редиректы Angie + #=================================================================== + proxy_redirect off; + + # Передаем оригинальный хост, чтобы бэкенд не путал домены proxy_set_header Host $http_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; - proxy_set_header X-Forwarded-Proto https; # Сигнализируем Ceph про HTTPS - #=================================================================== - # МАГИЯ АНДЖИ: Перехватываем и переписываем любые редиректы бэкенда - #=================================================================== - # Если Ceph шлет редирект на любой IP с портом 8080, подменяем его на наш домен - proxy_redirect ~^http://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:8080(.*)$ https://ceph-dashboard.guaranteedstruggle.host$1; - proxy_redirect default; - - # Дашборд использует SSE (Server-Sent Events) для графиков, отключаем буфер - proxy_buffering off; - proxy_read_timeout 3600s; - - - # Принудительно разрешаем прокидывать оригинальные заголовки типов от бэкенда - #proxy_pass_header Content-Type; - - - # Заставляем Angie прозрачно прокидывать сессионные куки из HTTP в HTTPS - proxy_cookie_path / "/; Secure; SameSite=Lax"; - - #=================================================================== - # СБРОС КЭША: Запрещаем браузеру запоминать "битые" HTML вместо JS - #=================================================================== - add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - expires off; + # Передаем эти ТРИ заголовка - они заставят CherryPy понять, + # что он работает в HTTPS и редиректы генерировать больше НЕ НАДО + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-Ssl on; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } } \ No newline at end of file