Skip to content

Commit dfdd69e

Browse files
authored
fix brotli enabling
1 parent 311272a commit dfdd69e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

addons/brotli-nginx.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ rm -f /etc/apt/sources.list.d/nginx*
2929
apt-get autoremove -y
3030

3131
# Enable Brotli
32-
install_of_not sponge
3332
install_if_not libnginx-mod-brotli
34-
{
35-
echo "# https://docs.nginx.com/nginx/admin-guide/dynamic-modules/brotli/"
36-
echo "load_module modules/ngx_http_brotli_filter_module.so; # for compressing responses on-the-fly"
37-
echo "load_module modules/ngx_http_brotli_static_module.so; # for serving pre-compressed files"
38-
} | cat - "$NGINX_CONF" | sponge "$NGINX_CONF"
39-
apt-get purge sponge -y
33+
if ! -[ /etc/nginx/modules-enabled/50-mod-http-brotli-filter.conf ]
34+
then
35+
echo "load_module modules/ngx_http_brotli_filter_module.so;" > /etc/nginx/modules-enabled/50-mod-http-brotli-filter.conf
36+
fi
4037

38+
# Restart Nginx
4139
if nginx -t
4240
then
4341
systemctl restart nginx

0 commit comments

Comments
 (0)