尝鲜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) 进行许可。

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