diff --git a/net/nginx-util/Makefile b/net/nginx-util/Makefile index 3fc0066f4b..bcf91de1e9 100644 --- a/net/nginx-util/Makefile +++ b/net/nginx-util/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nginx-util PKG_VERSION:=1.7 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Peter Stadler include $(INCLUDE_DIR)/package.mk diff --git a/net/nginx-util/files/uci.conf.template b/net/nginx-util/files/uci.conf.template index a9532576ce..3697f61bba 100644 --- a/net/nginx-util/files/uci.conf.template +++ b/net/nginx-util/files/uci.conf.template @@ -1,7 +1,7 @@ # Consider using UCI or creating files in /etc/nginx/conf.d/ for configuration. # Parsing UCI configuration is skipped if uci set nginx.global.uci_enable=false # For details see: https://openwrt.org/docs/guide-user/services/webserver/nginx -# UCI_CONF_VERSION=1.2 +# UCI_CONF_VERSION=1.3 worker_processes auto; @@ -27,6 +27,7 @@ http { gzip on; gzip_vary on; gzip_proxied any; + gzip_types *; root /www; diff --git a/net/nginx/Makefile b/net/nginx/Makefile index 825be29dd3..248e4f0d10 100644 --- a/net/nginx/Makefile +++ b/net/nginx/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nginx PKG_VERSION:=1.30.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://nginx.org/download/ diff --git a/net/nginx/files/nginx.init b/net/nginx/files/nginx.init index a6b6ebea3d..c1e23387e6 100644 --- a/net/nginx/files/nginx.init +++ b/net/nginx/files/nginx.init @@ -9,7 +9,7 @@ G_OPTS="daemon off;" NGINX_UTIL="/usr/bin/nginx-util" UCI_CONF_TEMPLATE="/etc/nginx/uci.conf.template" -LATEST_UCI_CONF_VERSION="1.2" +LATEST_UCI_CONF_VERSION="1.3" [ -f "${NGINX_UTIL}" ] && eval $("${NGINX_UTIL}" get_env) @@ -31,6 +31,12 @@ nginx_check_luci_template() { sed -i 's/events {/include module.d\/*.module;\n\nevents {/' $UCI_CONF_TEMPLATE fi + # Enable gzip for all content types + if [ "$UCI_CONF_VERSION" = "1.2" ]; then + grep -q 'gzip_types' $UCI_CONF_TEMPLATE || + sed -i 's/gzip_proxied any;/gzip_proxied any;\n\tgzip_types *;/' $UCI_CONF_TEMPLATE + fi + if [ "$UCI_CONF_VERSION" != "$LATEST_UCI_CONF_VERSION" ]; then sed -i "s/# UCI_CONF_VERSION=.*/# UCI_CONF_VERSION=$LATEST_UCI_CONF_VERSION/" $UCI_CONF_TEMPLATE fi