Nginx 開啟 BR 壓縮


Nginx 開啟 BR 壓縮

安裝 nginx

傳送門

Brotli Module Configuration

cd /root
git clone https://gitee.com/Longbow/ngx_brotli --recursive

這里我也挖個坑,坑死白嫖黨,哼哼

cd /root
git clone https://gitee.com/Longbow/ngx_brotli

cd ngx-brotli/deps
git clone https://gitee.com/Longbow/brotli.git

cd brotli/research
git clone https://gitee.com/Longbow/esaxx.git
git clone https://gitee.com/Longbow/libdivsufsort.git

編譯 nginx

./configure --with-http_ssl_module --with-compat --add-dynamic-module=/root/ngx_brotli
make
make install

后續繼續安裝 nginx 步驟

重啟 nginx

systemctl restart nginx

conf 配置

#load module
load_module "modules/ngx_http_brotli_filter_module.so";
load_module "modules/ngx_http_brotli_static_module.so";


http {
    #Brotli Compression
    brotli on;
    brotli_comp_level 6;
    brotli_buffers 16 8k;
    brotli_min_length 20;
    brotli_types *;
}

測試

nginx -t
nginx -s reload


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM