From 8bdcbdeb1aefbea0471fdd08063f4bd50dc58398 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 28 Nov 2024 22:20:14 +0100 Subject: [PATCH] better implementation Signed-off-by: Daniel Hansson --- lets-encrypt/activate-tls.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lets-encrypt/activate-tls.sh b/lets-encrypt/activate-tls.sh index 0e8933fb61..27e2e0af28 100644 --- a/lets-encrypt/activate-tls.sh +++ b/lets-encrypt/activate-tls.sh @@ -131,8 +131,23 @@ fi # Install Brotli if version 24.04 "$DISTRO" 26.04.10 then - install_if_not brotli - a2enmod brotli + if [ -z /etc/apache2/conf-available/brotli.conf ] + then + # Install needed packaages + install_if_not brotli + + # Add the config + { + echo "# Brotli support" + echo "" + echo " AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/x-font-ttf application/vnd.ms-fontobject image/x-icon" + echo "" + } > /etc/apache2/conf-available/brotli.conf + + # Enable the config + a2enmod brotli + a2enconf brotli + fi fi # Generate nextcloud_tls_domain.conf @@ -157,11 +172,6 @@ then SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost" - - # Brotli support - - AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/x-font-ttf application/vnd.ms-fontobject image/x-icon - # Intermediate configuration Header add Strict-Transport-Security: "max-age=15552000;includeSubdomains"