14 lines
475 B
Bash
14 lines
475 B
Bash
#!/bin/bash
|
|
|
|
# Проверяем наличие сертификатов
|
|
if [ -f "/etc/letsencrypt/live/yalarba.ru/fullchain.pem" ]; then
|
|
echo "SSL certificates found, 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
|