国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 黔西| 靖宇县| 应城市| 连平县| 堆龙德庆县| 庄浪县| 张家口市| 龙州县| 石棉县| 万全县| 江口县| 隆回县| 神农架林区| 弋阳县| 济南市| 永修县| 内乡县| 奇台县| 温宿县| 包头市| 盐城市| 长沙市| 徐州市| 镇江市| 柳江县| 马公市| 白朗县| 洛宁县| 夏邑县| 大埔县| 高雄县| 金堂县| 洛隆县| 陆川县| 晋中市| 社旗县| 澄江县| 怀仁县| 霍林郭勒市| 滨州市| 江山市|