Skip to content

Commit

Permalink
fix brotli enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 authored Oct 2, 2024
1 parent 311272a commit dfdd69e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions addons/brotli-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ rm -f /etc/apt/sources.list.d/nginx*
apt-get autoremove -y

# Enable Brotli
install_of_not sponge
install_if_not libnginx-mod-brotli
{
echo "# https://docs.nginx.com/nginx/admin-guide/dynamic-modules/brotli/"
echo "load_module modules/ngx_http_brotli_filter_module.so; # for compressing responses on-the-fly"
echo "load_module modules/ngx_http_brotli_static_module.so; # for serving pre-compressed files"
} | cat - "$NGINX_CONF" | sponge "$NGINX_CONF"
apt-get purge sponge -y
if ! -[ /etc/nginx/modules-enabled/50-mod-http-brotli-filter.conf ]

Check warning on line 33 in addons/brotli-nginx.sh

View check run for this annotation

codefactor.io / CodeFactor

addons/brotli-nginx.sh#L33

This flag is used as a command name. Bad line break or missing [ .. ]? (SC2215)
then
echo "load_module modules/ngx_http_brotli_filter_module.so;" > /etc/nginx/modules-enabled/50-mod-http-brotli-filter.conf
fi

# Restart Nginx
if nginx -t
then
systemctl restart nginx
Expand Down

0 comments on commit dfdd69e

Please sign in to comment.