From 837658edab004dfb6c179eae657f2c7b2eca3a52 Mon Sep 17 00:00:00 2001 From: hogweed1 Date: Mon, 2 Nov 2026 18:48:01 +1000 Subject: [PATCH] well, --- files/angie/lb1.guaranteedstruggle.host.conf | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/files/angie/lb1.guaranteedstruggle.host.conf b/files/angie/lb1.guaranteedstruggle.host.conf index 2b18ff5..3aac9b7 100644 --- a/files/angie/lb1.guaranteedstruggle.host.conf +++ b/files/angie/lb1.guaranteedstruggle.host.conf @@ -441,23 +441,39 @@ upstream ceph_dashboard_backend { server 192.168.0.89:8080 max_fails=3 fail_timeout=10s; } + server { listen 80; + server_name ceph-dashboard.guaranteedstruggle.host; + + # Принудительный редирект с HTTP на безопасный HTTPS + return 301 https://$host$request_uri; +} +server { + listen 443 ssl; 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; location / { proxy_pass http://ceph_dashboard_backend; 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 $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(.*)$ http://ceph-dashboard.guaranteedstruggle.host$1; + 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) для графиков, отключаем буфер