From ace0e0e2bfdca963d6670bdc80783018a632a5d4 Mon Sep 17 00:00:00 2001 From: Peca Date: Thu, 14 Aug 2025 19:36:57 +0200 Subject: [PATCH] SSL fix for Apache 2.4.65+ --- install/vst-install-debian.sh | 6 ++++++ src/deb/vesta/postinst | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index e8208113..419acf59 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -1145,6 +1145,12 @@ if [ "$nginx" = 'yes' ]; then echo > /etc/nginx/conf.d/vesta.conf mkdir -p /var/log/nginx/domains + + if [ "$apache" = 'yes' ]; then + # SSL fix for Apache 2.4.65+ + echo -e "proxy_ssl_server_name on;\nproxy_ssl_name \$host;\nproxy_ssl_session_reuse off;" > /etc/nginx/conf.d/fixssl.conf + fi + #update-rc.d nginx defaults #service nginx start currentservice='nginx' diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index ac034e82..da830507 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -27,6 +27,20 @@ VESTA="/usr/local/vesta" echo "1" > /usr/local/vesta/data/upgrades/show_changelog chmod a=rw /usr/local/vesta/data/upgrades/show_changelog +# SSL fix for Apache 2.4.65+ +if [ "$release" -ge 11 ]; then + if [ -f "/etc/apache2/apache2.conf" ] && [ -f "/etc/nginx/nginx.conf" ] && [ ! -f "/etc/nginx/conf.d/fixssl.conf" ]; then + echo "== Fixing SSL for Apache 2.4.65+" + echo -e "proxy_ssl_server_name on;\nproxy_ssl_name \$host;\nproxy_ssl_session_reuse off;" > /etc/nginx/conf.d/fixssl.conf + nginx_running=$(/usr/local/vesta/bin/v-list-sys-services | grep 'nginx' | grep -c 'running') + if [ $nginx_running -eq 1 ]; then + echo "== Restarting Nginx" + systemctl restart nginx + fi + fi +fi + +# Fixing cron job for fix-website-permissions-for-all-websites if grep -q "fix-website-permissions-for-all-websites" /usr/local/vesta/data/users/admin/cron.conf; then if ! grep -q "fix-website-permissions-for-all-websites-only-php" /usr/local/vesta/data/users/admin/cron.conf; then echo "== Renaming fix-website-permissions-for-all-websites to fix-website-permissions-for-all-websites-only-php"