尝鲜 部署 Nginx Quic

    技术2026-01-08  13

    文章目录

    一、介绍二、操作说明2.1、boringssl2.2、Nginx 使用参考资料及附录

    一、介绍

    Nginx正在QUIC分支上开发基于QUIC协议版本(所谓的HTTP3)的nginx,并且最近出了尝鲜版。

    下面介绍部署方法。

    二、操作说明

    1、下载 boringssl2、下载 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

    参考资料及附录

    官方使用手册Ubuntu18.04LTS下编译boringsslIntroducing a Technology Preview of NGINX Support for QUIC and HTTP/3

    本文由 qingchuwudi 译制或原创,除非另有声明,在不与原著版权冲突的前提下,本作品采用署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 进行许可。

    Processed: 0.014, SQL: 9