Skip to content

Commit

Permalink
better implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Nov 28, 2024
1 parent 18cc014 commit 8bdcbde
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lets-encrypt/activate-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<IfModule mod_brotli.c>"
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 "</IfModule>"
} > /etc/apache2/conf-available/brotli.conf

# Enable the config
a2enmod brotli
a2enconf brotli
fi
fi

# Generate nextcloud_tls_domain.conf
Expand All @@ -157,11 +172,6 @@ then
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost"
</FilesMatch>
# Brotli support
<IfModule mod_brotli.c>
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
</IfModule>
# Intermediate configuration
Header add Strict-Transport-Security: "max-age=15552000;includeSubdomains"
Expand Down

0 comments on commit 8bdcbde

Please sign in to comment.