b1c00072e8
update switch config nginx
18 lines
753 B
Bash
18 lines
753 B
Bash
#!/bin/bash
|
|
|
|
# Проверяем наличие сертификатов для всех трёх доменов
|
|
if \
|
|
[ -f "/etc/letsencrypt/live/yalarba.ru/fullchain.pem" ] && \
|
|
[ -f "/etc/letsencrypt/live/easysite102.ru/fullchain.pem" ] && \
|
|
[ -f "/etc/letsencrypt/live/valitovgaziz.ru/fullchain.pem" ] && \
|
|
[ -f "/etc/letsencrypt/live/бегущийбашкир.рф/fullchain.pem"]; then
|
|
echo "SSL certificates found for all domains, switching to HTTPS configuration"
|
|
ln -sf /etc/nginx/nginx-ssl.conf /etc/nginx/conf.d/default.conf
|
|
else
|
|
echo "SSL certificates not found, using HTTP only configuration"
|
|
ln -sf /etc/nginx/nginx-http.conf /etc/nginx/conf.d/default.conf
|
|
fi
|
|
|
|
# Проверяем конфигурацию nginx
|
|
nginx -t
|