From 7481b64d8f3fe0d2d89c27785867c6c17fcffa99 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Wed, 29 Nov 2023 23:28:58 +0700 Subject: [PATCH] nginx_build_script : lurking around with ngx_brotli --- nginx_build_script/configure.sh | 1 + nginx_build_script/modules.conf | 2 ++ nginx_build_script/modules.sh | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/nginx_build_script/configure.sh b/nginx_build_script/configure.sh index bbc4975..b115a43 100644 --- a/nginx_build_script/configure.sh +++ b/nginx_build_script/configure.sh @@ -48,6 +48,7 @@ --add-dynamic-module=mosc/nginx-dav-ext-module \ --add-dynamic-module=mosc/echo-nginx-module \ --add-dynamic-module=mosc/ModSecurity-nginx \ +--add-dynamic-module=mosc/ngx_brotli \ --with-http_v3_module \ --with-http_geoip_module \ --with-stream_geoip_module \ No newline at end of file diff --git a/nginx_build_script/modules.conf b/nginx_build_script/modules.conf index d3b60b1..522c19d 100644 --- a/nginx_build_script/modules.conf +++ b/nginx_build_script/modules.conf @@ -4,5 +4,7 @@ load_module /lib/nginx/modules/ngx_http_dav_ext_module.so; load_module /lib/nginx/modules/ngx_http_echo_module.so; load_module /lib/nginx/modules/ngx_http_headers_more_filter_module.so; load_module /lib/nginx/modules/ngx_http_modsecurity_module.so; +load_module /lib/nginx/modules/ngx_http_brotli_filter_module.so; +load_module /lib/nginx/modules/ngx_http_brotli_static_module.so; # load_module /lib/nginx/modules/ndk_http_module.so; # load_module /lib/nginx/modules/ngx_http_lua_module.so; \ No newline at end of file diff --git a/nginx_build_script/modules.sh b/nginx_build_script/modules.sh index e09e755..92bf70d 100644 --- a/nginx_build_script/modules.sh +++ b/nginx_build_script/modules.sh @@ -5,4 +5,14 @@ git clone https://github.com/openresty/echo-nginx-module git clone https://github.com/nginx-modules/ngx_cache_purge git clone https://github.com/SpiderLabs/ModSecurity-nginx # git clone https://github.com/openresty/lua-nginx-module -# git clone https://github.com/vision5/ngx_devel_kit \ No newline at end of file +# git clone https://github.com/vision5/ngx_devel_kit + +# Lurking with ngx_brotli +# The step will be a lot diffirent from another modules, as it a requirement from upstream repository. Not ME! + +git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli +cd ngx_brotli/deps/brotli +mkdir out && cd out +cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed .. +cmake --build . --config Release --target brotlienc +cd ../../../.. \ No newline at end of file