mirror of
https://github.com/openwrt/packages.git
synced 2026-12-05 17:35:56 +04:00
nginx-util: specify gzip_types to actually enable gzip
The nginx-util package was missing gzip_types configuration, which meant gzip compression was not being properly applied to responses. This change adds the necessary gzip_types directive to ensure content is compressed. Signed-off-by: Nikita Solianik <gxcreator@gmail.com> [ bump package release ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
1 parent
e0e531b86c
commit
fa48a6a567
4 files changed
+11
-4
No files matched your search
@@ -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 <peter.stadler@student.uibk.ac.at>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user