国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

將ngx_brotli編譯成動(dòng)態(tài)nginx模塊的方法

2024-08-30 12:23:37
字體:
供稿:網(wǎng)友
  Nginx從nginx 1.9.11開始就支持動(dòng)態(tài)模塊,所以我們嘗試一下把gx_brotli編譯成動(dòng)態(tài)nginx模塊,安裝前的系統(tǒng)需求是:
  sudo apt-get install autoconf libtool nginx-extras.
  本文的測(cè)試環(huán)境是ubuntu 14.04, ppa:nginx/stable, nginx/1.10.1.
  首先安裝libbrotli:
  git clone https://github.com/bagder/libbrotli
  ./autogen.sh
  ./configure
  make
  sudo make install.
  為了讓libbrotli的程序能夠加載so文件,所以我們創(chuàng)建一個(gè)軟鏈:
  sudo ln -s /usr/local/lib/libbrotlienc.so.1 /lib/libbrotlienc.so.1.
  然后下載好nginx和ngx_brotli的源代碼:
  wget http://nginx.org/download/nginx-1.10.1.tar.gz
  git clone https://github.com/google/ngx_brotli
  編輯ngx_brotli/config文件,在頂部添加如下一行:
  have=NGX_HTTP_HEADERS . auto/have
  然后就在nginx源碼目錄執(zhí)行configure:
  ./configure /
  --add-dynamic-module=../ngx_brotli/ /
  --with-http_dav_module /
  --with-http_realip_module /
  --with-http_v2_module /
  --with-threads /
  --with-http_ssl_module /
  --with-ipv6
  并make,則到兩個(gè)so文件:
  $ find -name ngx_http_brotli*.so
  ./objs/ngx_http_brotli_static_module.so
  ./objs/ngx_http_brotli_filter_module.so
  最后加載模塊:
  在/etc/nginx/nginx.conf文件中把下面兩行加入,使nginx加載模塊:
  load_module '/path/to/ngx_http_brotli_static_module.so';
  load_module '/path/to/ngx_http_brotli_filter_module.so';
  最后在http段中加入下面兩個(gè)配置:
  brotli on;
  brotli_static on;
  最后執(zhí)行sudo nginx -t 看看有沒有錯(cuò)誤,如果沒有錯(cuò)誤的話那就成功了。不過,brotli壓縮算法只有在https連接中才會(huì)生效。
 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 博湖县| 安新县| 滦南县| 永福县| 阿图什市| 长沙市| 云浮市| 龙州县| 余庆县| 仙居县| 获嘉县| 苏尼特右旗| 佛冈县| 建瓯市| 霍林郭勒市| 庆安县| 新河县| 金阳县| 响水县| 三亚市| 文水县| 武隆县| 武清区| 岱山县| 富顺县| 库车县| 广昌县| 思南县| 新蔡县| 册亨县| 桂平市| 凭祥市| 宜春市| 博爱县| 东辽县| 乌兰浩特市| 盖州市| 琼结县| 桐庐县| 乌苏市| 衡南县|