modified: serv_nginx/nginx/nginx-ssl.conf

modified:   serv_nginx/nginx/switch-config.sh
fix bag into switch-config.sh nginx
add settings into nginx-ssl.conf for auth.yalarba.ru domain
This commit is contained in:
valitovgaziz
2025-09-10 15:51:50 +05:00
parent 3f88ea631c
commit 2213091657
2 changed files with 38 additions and 1 deletions
+37
View File
@@ -119,3 +119,40 @@ server {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
} }
server {
listen 80;
server_name keycloak.yalarba.ru;
# Перенаправление HTTP на HTTPS
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name keycloak.yalarba.ru;
# SSL сертификаты
ssl_certificate /etc/letsencrypt/live/auth.yalarba.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.yalarba.ru/privkey.pem;
# SSL настройки
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# Проксирование запросов к Keycloak
location / {
proxy_pass http://keycloak;
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_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Важные настройки для Keycloak
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ if \
[ -f "/etc/letsencrypt/live/valitovgaziz.ru/fullchain.pem" ] && \ [ -f "/etc/letsencrypt/live/valitovgaziz.ru/fullchain.pem" ] && \
[ -f "/etc/letsencrypt/live/begushiybashkir.ru/fullchain.pem" ] && \ [ -f "/etc/letsencrypt/live/begushiybashkir.ru/fullchain.pem" ] && \
[ -f "/etc/letsencrypt/live/xn--80abahjtcfl5d0a8di.xn--p1ai/fullchain.pem" ] [ -f "/etc/letsencrypt/live/xn--80abahjtcfl5d0a8di.xn--p1ai/fullchain.pem" ]
[ -f "/etc/letsencrypt/live/auth.yalarba.ru.pem" ]; then [ -f "/etc/letsencrypt/live/auth.yalarba.ru/fullchain.pem" ]; then
echo "SSL certificates found for all domains, switching to HTTPS configuration" echo "SSL certificates found for all domains, switching to HTTPS configuration"
ln -sf /etc/nginx/nginx-ssl.conf /etc/nginx/conf.d/default.conf ln -sf /etc/nginx/nginx-ssl.conf /etc/nginx/conf.d/default.conf
else else