LNMP Nginx 安装 brotli 模块

LNMP Nginx 安装 brotli 模块

小小孩
2024-02-27 / 0 评论 / 71 阅读 / 正在检测是否收录...

lnmp 安装

wget https://soft.lnmp.com/lnmp/lnmp2.0.tar.gz -O lnmp2.0.tar.gz && tar zxf lnmp2.0.tar.gz && cd lnmp2.0 && ./install.sh lnmp

nginx 安装 brotli

cd /root
git clone --recurse-submodules -j8 https://gitee.com/hipi/ngx_brotli.git
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 /root

编辑lnmp安装包下的

/root/lnmp2.0/lnmp.conf

在 Nginx_Modules_Options=" 的引号内加上

--add-module=/root/ngx_brotli

保存

./upgrade.sh nginx

升级一下nginx,版本号填写当前版本号就行
升级完成就支持broti了,

0

评论 (0)

取消