diff --git a/README.md b/README.md index 7d11b6d..400f3b6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This is a high-performance version of NGINX, which has been enhanced by Alwatr f ## Usage -The recommended method for using the Alwatr Nginx is to place it behind a Kubernetes ingress or a simple edge reverse-proxy like Traefik. In this setup, there's no need to configure edge features such as gzip compression, SSL, etc., or even set up a domain or multiple websites. +The recommended method for using the Alwatr Nginx is to place it behind a Kubernetes ingress or a simple edge reverse-proxy like Traefik. +In this setup, there's no need to configure edge features such as SSL, Domain, etc. in the Alwatr Nginx. ```Dockerfile FROM ghcr.io/alwatr/nginx:2 diff --git a/nginx-cdn/Dockerfile b/nginx-cdn/Dockerfile index 1d91b69..bd5932b 100644 --- a/nginx-cdn/Dockerfile +++ b/nginx-cdn/Dockerfile @@ -19,6 +19,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ NGINX_EXPIRES_DEFAULT=max \ NGINX_LIMIT_REQ_RATE=200 \ NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_GZIP=on \ + NGINX_GZIP_VARY=on \ + NGINX_GZIP_COMP_LEVEL=5 \ + NGINX_GZIP_MIN_LENGTH=256 \ NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV diff --git a/nginx-core/Dockerfile b/nginx-core/Dockerfile index aa7c033..0919a25 100644 --- a/nginx-core/Dockerfile +++ b/nginx-core/Dockerfile @@ -37,6 +37,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=10m \ NGINX_EXPIRES_DEFAULT=epoch \ NGINX_LIMIT_REQ_RATE=200 \ NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_GZIP=on \ + NGINX_GZIP_VARY=on \ + NGINX_GZIP_COMP_LEVEL=5 \ + NGINX_GZIP_MIN_LENGTH=256 \ NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV diff --git a/nginx-core/etc/nginx/templates/http.d/61-gzip.conf.template b/nginx-core/etc/nginx/templates/http.d/61-gzip.conf.template new file mode 100644 index 0000000..9b4d258 --- /dev/null +++ b/nginx-core/etc/nginx/templates/http.d/61-gzip.conf.template @@ -0,0 +1,35 @@ +gzip $NGINX_GZIP; +gzip_comp_level $NGINX_GZIP_COMP_LEVEL; +gzip_vary $NGINX_GZIP_VARY; +gzip_min_length $NGINX_GZIP_MIN_LENGTH; +gzip_disable "MSIE [1-6].(?!.*SV1)"; +gzip_buffers 32 4k; +gzip_proxied any; +gzip_types + application/ecmascript + application/javascript + application/json + application/postscript + application/font-woff + application/x-javascript + application/vnd.ms-fontobject + application/x-font-opentype + application/x-font-truetype + application/x-font-ttf + application/xml + image/gif + image/svg+xml + image/x-icon + text/x-component + text/x-js + text/css + text/csv + text/javascript + text/plain + text/xml + text/xsd + text/xsl + font/eot + font/opentype + font/otf + font/woff diff --git a/nginx-core/etc/nginx/templates/http.d/62-brotli.conf.skip b/nginx-core/etc/nginx/templates/http.d/62-brotli.conf.skip new file mode 100644 index 0000000..a415205 --- /dev/null +++ b/nginx-core/etc/nginx/templates/http.d/62-brotli.conf.skip @@ -0,0 +1,52 @@ +brotli on; +brotli_static on; +brotli_comp_level 6; +brotli_min_length 1000; +brotli_buffers 32 8k; +brotli_types + application/ecmascript + application/javascript + application/json + application/pdf + application/postscript + application/font-woff + application/font-woff2 + application/x-javascript + application/vnd.ms-fontobject + application/x-font-opentype + application/x-font-truetype + application/x-font-ttf + application/xml + image/gif + image/jpeg + image/png + image/svg+xml + image/tiff + image/vnd.microsoft.icon + image/x-icon + image/webp + text/x-component + text/x-js + text/css + text/csv + text/javascript + text/plain + text/xml + text/xsd + text/xsl + font/eot + font/opentype + font/otf + font/woff + font/woff2 + video/3gpp + video/mp4 + video/mpeg + video/ogg + video/quicktime + video/webm + video/x-flv + video/x-mng + video/x-ms-asf + video/x-ms-wmv + video/x-msvideo; diff --git a/nginx-json/Dockerfile b/nginx-json/Dockerfile index 37c2791..6bf6504 100644 --- a/nginx-json/Dockerfile +++ b/nginx-json/Dockerfile @@ -19,6 +19,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ NGINX_EXPIRES_DEFAULT=epoch \ NGINX_LIMIT_REQ_RATE=400 \ NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_GZIP=on \ + NGINX_GZIP_VARY=on \ + NGINX_GZIP_COMP_LEVEL=5 \ + NGINX_GZIP_MIN_LENGTH=256 \ NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV diff --git a/nginx-pwa/Dockerfile b/nginx-pwa/Dockerfile index 6be917a..69b8275 100644 --- a/nginx-pwa/Dockerfile +++ b/nginx-pwa/Dockerfile @@ -19,6 +19,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ NGINX_EXPIRES_DEFAULT=epoch \ NGINX_LIMIT_REQ_RATE=400 \ NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_GZIP=on \ + NGINX_GZIP_VARY=on \ + NGINX_GZIP_COMP_LEVEL=5 \ + NGINX_GZIP_MIN_LENGTH=256 \ NGINX_DISABLE_SYMLINKS=if_not_owner \ NGINX_CONFIG_JS_PATH=/data/config.js diff --git a/nginx-ws/Dockerfile b/nginx-ws/Dockerfile index 341c4cd..66a712c 100644 --- a/nginx-ws/Dockerfile +++ b/nginx-ws/Dockerfile @@ -19,6 +19,10 @@ ENV NGINX_CLIENT_MAX_BODY_SIZE=1k \ NGINX_EXPIRES_DEFAULT=epoch \ NGINX_LIMIT_REQ_RATE=400 \ NGINX_LIMIT_REQ_BURST=1000 \ + NGINX_GZIP=on \ + NGINX_GZIP_VARY=on \ + NGINX_GZIP_COMP_LEVEL=5 \ + NGINX_GZIP_MIN_LENGTH=256 \ NGINX_DISABLE_SYMLINKS=if_not_owner ARG BUILD_REV