Skip to content

nginx开启 基于QUIC协议的http3

编译

bash
./configure --with-http_ssl_module \
            --with-http_v2_module \
            --with-http_v3_module && \
            make && make install

配置

text
http{
    server {
        listen 443 ssl;
        listen 443 quic reuseport;
        server_name  localhost;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_certificate      /usr/local/nginx/cert/server.pem;
        ssl_certificate_key  /usr/local/nginx/cert/server.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
        add_header Alt-Svc 'quic=":443"; h3-27=":443";h3-25=":443"; h3-T050=":443"; h3-Q050=":443";h3-Q049=":443";h3-Q048=":443"; h3-Q046=":443"; h3-Q043=":443"'; # Advertise that QUIC is available
        location / {
            root   html;
            index  index.html index.htm;
        }
    }
}