File tree 4 files changed +21
-3
lines changed
4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ RUN set -x \
8
8
&& apt-get install -y --no-install-suggests \
9
9
libluajit-5.1-dev libpam0g-dev zlib1g-dev libpcre3-dev libpcre2-dev \
10
10
libexpat1-dev git curl build-essential lsb-release libxml2 libxslt1.1 libxslt1-dev autoconf libtool libssl-dev \
11
- unzip libmaxminddb-dev
11
+ unzip libmaxminddb-dev libbrotli-dev
12
12
13
13
ARG openresty_package_version=1.27.1.1-1~bookworm1
14
14
RUN set -x \
@@ -38,7 +38,7 @@ RUN set -x \
38
38
module_repo=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+).*@\1 @g' ); \
39
39
module_tag=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+):?([^:/]*)@\4 @g' ); \
40
40
dirname=$(echo "${module_repo}" | sed -E 's@^.*/|\. .*$@@g' ); \
41
- git clone "${module_repo}" ; \
41
+ git clone --recursive "${module_repo}" ; \
42
42
cd ${dirname}; \
43
43
git fetch --tags; \
44
44
if [ -n "${module_tag}" ]; then \
@@ -108,6 +108,7 @@ RUN set -x \
108
108
unzip \
109
109
vim-tiny \
110
110
libmaxminddb0 \
111
+ libbrotli1 \
111
112
&& apt-get clean \
112
113
&& rm -rf /var/lib/apt/lists/* \
113
114
&& ldconfig -v \
Original file line number Diff line number Diff line change 14
14
" https://github.com/vozlt/nginx-module-vts.git:v0.2.1" ,
15
15
" https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git" ,
16
16
" https://github.com/leev/ngx_http_geoip2_module:3.4" ,
17
- " https://github.com/wandenberg/nginx-sorted-querystring-module.git"
17
+ " https://github.com/wandenberg/nginx-sorted-querystring-module.git" ,
18
+ " https://github.com/google/ngx_brotli.git:a71f9312c2deb28875acc7bacfdd5695a111aa53"
18
19
],
19
20
"lua_modules" : [
20
21
" tsuru-rpaasv2 INOTIFY_INCDIR=/usr/include/linux-gnu" ,
Original file line number Diff line number Diff line change @@ -29,10 +29,19 @@ test_lua_http_resty() {
29
29
assert ' {"body":"nginx config check ok\n","proxied":true}' " $response " " /lua_http_resty with expected response"
30
30
}
31
31
32
+ test_brotli () {
33
+ response=$( curl --fail --silent --show-error localhost:8080/brotli)
34
+ assert ' <b>Brotli page</b>' " $response " " /brotli without compression response"
35
+
36
+ response=$( curl --fail --silent --show-error -H ' Accept-Encoding: br' localhost:8080/brotli | base64)
37
+ assert ' BQmAPGI+QnJvdGxpIHBhZ2U8L2I+CgM=' " $response " " /brotli with brotli compression response"
38
+ }
39
+
32
40
echo " Running tests"
33
41
34
42
test_nginx_serving_request
35
43
test_lua_content
36
44
test_lua_http_resty
45
+ test_brotli
37
46
38
47
echo " ✅ SUCESS: All tests passed"
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ http {
79
79
}
80
80
}
81
81
82
+ location /brotli {
83
+ brotli on;
84
+ default_type 'text/html';
85
+ brotli_types text/html text/plain;
86
+ echo '<b>Brotli page</b>';
87
+ }
88
+
82
89
location ~ ^/purge/(.+) {
83
90
proxy_cache_purge cache_zone $1$is_args$args;
84
91
}
You can’t perform that action at this time.
0 commit comments