This commit is contained in:
@@ -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) для графиков, отключаем буфер
|
||||
|
||||
Reference in New Issue
Block a user