diff --git a/files/angie/lb1.guaranteedstruggle.host.conf b/files/angie/lb1.guaranteedstruggle.host.conf index 6dc5800..d78d4d1 100644 --- a/files/angie/lb1.guaranteedstruggle.host.conf +++ b/files/angie/lb1.guaranteedstruggle.host.conf @@ -440,50 +440,44 @@ upstream ceph_dashboard_backend { server 192.168.0.71:8080 max_fails=3 fail_timeout=10s; server 192.168.0.72:8080 max_fails=3 fail_timeout=10s; server 192.168.0.73:8080 max_fails=3 fail_timeout=10s; + server 192.168.0.74:8080 max_fails=3 fail_timeout=10s; server 192.168.0.75:8080 max_fails=3 fail_timeout=10s; server 192.168.0.89:8080 max_fails=3 fail_timeout=10s; } -server { - listen 80; - server_name ceph-dashboard.guaranteedstruggle.host; +# server { +# listen 80; +# server_name ceph-dashboard.guaranteedstruggle.host; - # Принудительный редирект с HTTP на безопасный HTTPS - return 301 https://$host$request_uri; -} +# # Принудительный редирект с HTTP на безопасный HTTPS +# return 301 https://$host$request_uri; +# } server { - listen 443 ssl; + #listen 443 ssl; + listen 80; server_name ceph-dashboard.guaranteedstruggle.host; # Имя для админки #http2 on; - ssl_certificate /etc/angie/ssl/ceph-dashboard.guaranteedstruggle.host/cert.pem; - ssl_certificate_key /etc/angie/ssl/ceph-dashboard.guaranteedstruggle.host/key.pem; - - # Оптимальные параметры TLS - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers HIGH:!aNULL:!MD5; - - #=================================================================== - # ПЕРВЫЙ РУБЕЖ: Если пользователь ввел домен без слэша, - # Angie САМ аккуратно редиректит его на домен СО СЛЭШЕМ внутри HTTPS. - #=================================================================== - location = / { - return 301 https://ceph-dashboard.guaranteedstruggle.host; - } + # ssl_certificate /etc/angie/ssl/ceph-dashboard.guaranteedstruggle.host/cert.pem; + # ssl_certificate_key /etc/angie/ssl/ceph-dashboard.guaranteedstruggle.host/key.pem; + # # Оптимальные параметры TLS + # ssl_protocols TLSv1.2 TLSv1.3; + # ssl_ciphers HIGH:!aNULL:!MD5; + location / { - # Ставим замыкающий слэш на бэкенд — это КРИТИЧЕСКИ важно для CherryPy! - proxy_pass http://ceph_dashboard_backend/; + # Перенаправляем клиента напрямую в апстрим. + # Браузер получит от Ceph заголовок Location с IP-адресом активной ноды, + # Angie не будет его блокировать (proxy_redirect off), и браузер успешно переедет. + proxy_pass http://ceph_dashboard_backend; + proxy_redirect off; - # Возвращаем дефолтный Host. CherryPy примет его, так как слэш уже на месте. - proxy_set_header Host $http_host; - + proxy_set_header Host $proxy_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 https; - # Полностью блокируем любые попытки бэкенда переписать заголовки - proxy_redirect off; + proxy_buffering off; + proxy_read_timeout 3600s; } } \ No newline at end of file