Skip to content

Commit

Permalink
Added zstd content encoding support through zstd-nginx-module
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanoostenrijk committed Dec 14, 2024
1 parent ca038c5 commit d492bcc
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG AWS_LC_TAG=v1.41.1 \
MODULE_NGINX_MISC=v0.33 \
MODULE_NGINX_NJS=0.8.8 \
MODULE_NGINX_VTS=v0.2.2 \
MODULE_NGINX_ZSTD=0.1.1 \
NGINX=1.27.3

ARG SSL_LIBRARY=openssl
Expand Down Expand Up @@ -52,7 +53,9 @@ apk add --no-cache --virtual .build-deps \
pcre2-dev \
samurai \
xz-static \
zlib-static
zlib-static \
zstd-dev \
zstd-static

#
# Prepare destination scratchfs
Expand Down Expand Up @@ -131,6 +134,11 @@ curl --silent --location https://github.com/vozlt/nginx-module-vts/archive/refs/
#
curl --silent --location https://github.com/yaoweibin/ngx_http_substitutions_filter_module/tarball/master | tar xz -C /usr/src --one-top-level=ngx_http_substitutions_filter_module --strip-components=1 || exit 1

#
# Module: zstd-nginx-module
#
curl --silent --location https://github.com/tokers/zstd-nginx-module/archive/refs/tags/${MODULE_NGINX_ZSTD}.tar.gz | tar xz -C /usr/src --one-top-level=zstd-nginx-module --strip-components=1 || exit 1

#
# Module: njs
#
Expand Down Expand Up @@ -222,7 +230,7 @@ patch -p1 < /usr/src/aws-lc-nginx.patch || exit 1
CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
./configure \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_MISC} njs-${MODULE_NGINX_NJS} ngx-http-substitutions-filter-module-latest" \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_MISC} ngx-http-substitutions-filter-module-latest zstd-nginx-module-${MODULE_NGINX_ZSTD} njs-${MODULE_NGINX_NJS}" \
--prefix=/var/lib/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
Expand Down Expand Up @@ -272,6 +280,7 @@ CXX=/usr/bin/clang++ \
--add-module=/usr/src/nginx-module-vts \
--add-module=/usr/src/ngx_brotli \
--add-module=/usr/src/ngx_http_substitutions_filter_module \
--add-module=/usr/src/zstd-nginx-module \
--add-module=/usr/src/njs/nginx \
--add-module=/usr/src/set-misc-nginx-module \
--without-http_browser_module \
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile.body
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ apk add --no-cache --virtual .build-deps \
pcre2-dev \
samurai \
xz-static \
zlib-static
zlib-static \
zstd-dev \
zstd-static

#
# Prepare destination scratchfs
Expand Down Expand Up @@ -113,6 +115,11 @@ curl --silent --location https://github.com/vozlt/nginx-module-vts/archive/refs/
#
curl --silent --location https://github.com/yaoweibin/ngx_http_substitutions_filter_module/tarball/master | tar xz -C /usr/src --one-top-level=ngx_http_substitutions_filter_module --strip-components=1 || exit 1

#
# Module: zstd-nginx-module
#
curl --silent --location https://github.com/tokers/zstd-nginx-module/archive/refs/tags/${MODULE_NGINX_ZSTD}.tar.gz | tar xz -C /usr/src --one-top-level=zstd-nginx-module --strip-components=1 || exit 1

#
# Module: njs
#
Expand Down Expand Up @@ -204,7 +211,7 @@ patch -p1 < /usr/src/aws-lc-nginx.patch || exit 1
CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
./configure \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_MISC} njs-${MODULE_NGINX_NJS} ngx-http-substitutions-filter-module-latest" \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_MISC} ngx-http-substitutions-filter-module-latest zstd-nginx-module-${MODULE_NGINX_ZSTD} njs-${MODULE_NGINX_NJS}" \
--prefix=/var/lib/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
Expand Down Expand Up @@ -254,6 +261,7 @@ CXX=/usr/bin/clang++ \
--add-module=/usr/src/nginx-module-vts \
--add-module=/usr/src/ngx_brotli \
--add-module=/usr/src/ngx_http_substitutions_filter_module \
--add-module=/usr/src/zstd-nginx-module \
--add-module=/usr/src/njs/nginx \
--add-module=/usr/src/set-misc-nginx-module \
--without-http_browser_module \
Expand Down
9 changes: 8 additions & 1 deletion build-freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ curl --silent --location https://github.com/vozlt/nginx-module-vts/archive/refs/
echo "[i] Downloading: ngx_http_substitutions_filter_module"
curl --silent --location https://github.com/yaoweibin/ngx_http_substitutions_filter_module/tarball/master | gtar xz -C /usr/src --one-top-level=ngx_http_substitutions_filter_module --strip-components=1 || exit 1

#
# Module: zstd-nginx-module
#
echo "[i] Downloading: zstd-nginx-module"
curl --silent --location https://github.com/tokers/zstd-nginx-module/archive/refs/tags/${MODULE_NGINX_ZSTD}.tar.gz | gtar xz -C /usr/src --one-top-level=zstd-nginx-module --strip-components=1 || exit 1

#
# Module: njs
#
Expand Down Expand Up @@ -117,7 +123,7 @@ patch -p1 < ${BASE_DIR}/patches/aws-lc-nginx.patch || exit 1
CC=/usr/bin/clang \
CXX=/usr/bin/clang++ \
./configure \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_HEADERS_MORE} njs-${MODULE_NGINX_NJS} ngx-http-substitutions-filter-module-latest" \
--build="${SSL_COMMIT} ngx_brotli-$(git --git-dir=/usr/src/ngx_brotli/.git rev-parse --short HEAD) ngx-devel-kit-${MODULE_NGINX_DEVEL_KIT} headers-more-nginx-module-${MODULE_NGINX_HEADERS_MORE} echo-nginx-module-${MODULE_NGINX_ECHO} nginx-module-vts-${MODULE_NGINX_VTS} nginx-cookie-flag-module-${MODULE_NGINX_COOKIE_FLAG} set-misc-nginx-module-${MODULE_NGINX_MISC} ngx-http-substitutions-filter-module-latest zstd-nginx-module-${MODULE_NGINX_ZSTD} njs-${MODULE_NGINX_NJS}" \
--prefix=/usr/local/etc/nginx \
--sbin-path=/usr/local/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
Expand Down Expand Up @@ -163,6 +169,7 @@ CXX=/usr/bin/clang++ \
--add-module=/usr/src/nginx-module-vts \
--add-module=/usr/src/ngx_brotli \
--add-module=/usr/src/ngx_http_substitutions_filter_module \
--add-module=/usr/src/zstd-nginx-module \
--add-module=/usr/src/njs/nginx \
--add-module=/usr/src/set-misc-nginx-module \
--without-http_browser_module \
Expand Down
1 change: 1 addition & 0 deletions scripts/build-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ARG AWS_LC_TAG=${AWS_LC_TAG} \\
MODULE_NGINX_MISC=${MODULE_NGINX_MISC} \\
MODULE_NGINX_NJS=${MODULE_NGINX_NJS} \\
MODULE_NGINX_VTS=${MODULE_NGINX_VTS} \\
MODULE_NGINX_ZSTD=${MODULE_NGINX_ZSTD} \\
NGINX=${NGINX}
EOF
Expand Down
1 change: 1 addition & 0 deletions scripts/update_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ cat <<- EOF > versions.env
MODULE_NGINX_MISC=v$(get_latest_tag openresty/set-misc-nginx-module v)
MODULE_NGINX_NJS=$(get_latest_tag nginx/njs)
MODULE_NGINX_VTS=v$(get_latest_tag vozlt/nginx-module-vts v)
MODULE_NGINX_ZSTD=$(get_latest_tag tokers/zstd-nginx-module)
NGINX=$(get_latest_tag nginx/nginx release)
EOF
1 change: 1 addition & 0 deletions versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ MODULE_NGINX_HEADERS_MORE=v0.37
MODULE_NGINX_MISC=v0.33
MODULE_NGINX_NJS=0.8.8
MODULE_NGINX_VTS=v0.2.2
MODULE_NGINX_ZSTD=0.1.1
NGINX=1.27.3

0 comments on commit d492bcc

Please sign in to comment.