From 3b34c6304f3867156266b8e05a590438b446f85b Mon Sep 17 00:00:00 2001 From: Sascha Date: Thu, 9 Jan 2025 16:33:26 +0100 Subject: [PATCH 1/2] feat: add brotli module --- nginx/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 7f482bd..85d9a24 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -3,7 +3,7 @@ # SEE https://github.com/nginxinc/docker-nginx/tree/master/modules FROM nginx:1.27.3 AS builder -ENV ENABLED_MODULES="headers-more subs-filter geoip2" +ENV ENABLED_MODULES="headers-more subs-filter geoip2 brotli" SHELL ["/bin/bash", "-exo", "pipefail", "-c"] RUN if [ "$ENABLED_MODULES" = "" ]; then \ From c6109c9ab329939f6b497721935d451439ce283f Mon Sep 17 00:00:00 2001 From: Sascha Date: Thu, 9 Jan 2025 16:39:35 +0100 Subject: [PATCH 2/2] feat: move gzip config so it can be easily overwritten or removed --- nginx/etc/nginx/conf.d/gzip.conf | 7 +++++++ nginx/etc/nginx/nginx.conf | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 nginx/etc/nginx/conf.d/gzip.conf diff --git a/nginx/etc/nginx/conf.d/gzip.conf b/nginx/etc/nginx/conf.d/gzip.conf new file mode 100644 index 0000000..bc71a29 --- /dev/null +++ b/nginx/etc/nginx/conf.d/gzip.conf @@ -0,0 +1,7 @@ +## +# Gzip Settings +## +gzip on; +gzip_vary on; +gzip_proxied any; +gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; diff --git a/nginx/etc/nginx/nginx.conf b/nginx/etc/nginx/nginx.conf index 2d2ed83..210b72a 100644 --- a/nginx/etc/nginx/nginx.conf +++ b/nginx/etc/nginx/nginx.conf @@ -37,14 +37,6 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - ## - # Gzip Settings - ## - gzip on; - gzip_vary on; - gzip_proxied any; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; - ## # Custom Configs ##