嚐鮮Nginx-Quic

一、介紹

Nginx正在QUIC分支上開發基於QUIC協議版本(所謂的HTTP3)的nginx,並且最近出了嚐鮮版。

下面介紹嚐鮮攻略。

二、操作說明

  • 1、下載 boringssl
  • 2、下載 Nginx 並編譯安裝

2.1、boringssl

BoringSSL 是由谷歌開發,從 OpenSSL 中分離的一個分支。

## 創建目錄
$ mkdir ~/NginxWithQuic
$ cd ~/NginxWithQuic

## 下載代碼
$ git clone https://github.com/google/boringssl.git

## 編譯代碼
$ cd boringssl
$ mkdir build
$ cd build
$ cmake ..
$ make

2.2、Nginx

cd ~/NginxWithQuic

## 下載代碼
$ hg clone -b quic https://hg.nginx.org/nginx-quic
$ cd nginx-quic
## 配置
## 可以自定義目錄,參數可以通過 ./auto/configure --help 查看
$ ./auto/configure --with-debug --with-http_v3_module \
      --with-cc-opt="-I../boringssl/include" \
      --with-ld-opt="-L../boringssl/build/ssl \
      -L../boringssl/build/crypto"
$ make
## 安裝
$ sudo make install

也可以去直接下載壓縮包:nginx-quic-quic.tar.gz

使用

進入目錄 /usr/local/nginx 自行修改配置、啓動服務。

/usr/local/nginx

➜  tree /usr/local/nginx                       
nginx
├── conf
│   ├── fastcgi.conf
│   ├── fastcgi.conf.default
│   ├── fastcgi_params
│   ├── fastcgi_params.default
│   ├── koi-utf
│   ├── koi-win
│   ├── mime.types
│   ├── mime.types.default
│   ├── nginx.conf
│   ├── nginx.conf.default
│   ├── scgi_params
│   ├── scgi_params.default
│   ├── uwsgi_params
│   ├── uwsgi_params.default
│   └── win-utf
├── html
│   ├── 50x.html
│   └── index.html
├── logs
└── sbin
    └── nginx

4 directories, 18 files

參考資料及附錄


本文由 qingchuwudi 譯製或原創,除非另有聲明,在不與原著版權衝突的前提下,本作品採用署名-非商業性使用-相同方式共享 4.0 國際 (CC BY-NC-SA 4.0) 進行許可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章