nginx openresty配置 Brotli压缩
发布日期:2021-11-02 06:36:25 浏览次数:33 分类:技术文章

本文共 839 字,大约阅读时间需要 2 分钟。

记录:智能压缩包括Gzip压缩和Brotli压缩,记录一下nginx配置Brotli压缩。

一、下载ngx_brotli

github下载地址:https://github.com/google/ngx_brotli,放在项目服务器的 usr/loacl/src文件下:

二、编译openresty

1.命令行cd到openresty目录:cd /usr/local/src/openresty-1.15.8.3

2.命令执行:

./configure   --add-module=/usr/local/src/ngx_brotli

若之前已经编译了页面压缩、http2、openssl-1.1.1g等,则必须重新再次编译:

./configure   --add-module=/usr/local/src/ngx_brotli  --with-http_v2_module --with-openssl=/usr/local/src/openssl-1.1.1g  --add-module=/usr/local/src/ngx_http_trim_filter_module

3.然后 make 即可 (不要make install),编译成功。

三、将编译好的nginx配置文件替换项目中的nginx配置文件:

1,关闭nginx:./nginx -s stop (进到/usr/local/openresty/nginx/sbin目录执行)

2,将/usr/local/src/openresty-1.15.8.3/build/nginx-1.15.8/objs下的nginx配置文件复制,到/usr/local/openresty/nginx/sbin即可,记得sbin文件夹下面的nginx备份一下。
3,最后启动nginx (./nginx),查看版本(./nginx -V),可以看到此模块已安装:

(接上篇博客:nginx openresty配置页面压缩)

转载地址:https://blog.csdn.net/weixin_43652106/article/details/107808623 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:nginx openresty升级openssl
下一篇:lua脚本加载并编译外部的lua运行脚本

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年03月28日 19时02分35秒