Image

Knowledge base → Enabling http/3 support in nginx

[Virtual servers]
Date of publication: 21.05.2024

Support for the QUIC and HTTP/3 protocols is available starting from nginx version 1.25.0.

You can check the current version with the command:

nginx -v

The following parameters must be added to the basic configuration file:

listen 443 quic reuseport;
...
# enable http3 support
http3 on;
# enable GSO
quick_gso on;
# allow address verification
quick_retry on;

...
# to redirect browsers to quic port
add_header Alt-Svc 'h3=":443";max=86400';
...

The final configuration file will look something like this:

server
{
     # for better compatibility it is recommended to use the same port for quic and https
     # specify the quic protocol and the reuseport parameter for proper work with multiple worker processes
     listen 443 quic reuseport;
     listen 443 ssl;

     # enable http2 support
     http2 on;
     # enable http3 support
     http3 on;
     # enable GSO
     quick_gso on;
     # allow address verification
     quick_retry on;

     # QUIC requires TLSv1.3 protocol version.
     ssl_protocols TLSv1.2 TLSv1.3;

     ssl_certificate /path_certs/fullchain-ssl.pem;
     ssl_certificate_key /path_certs/key.pem;

     # to redirect browsers to quic port
     add_header Alt-Svc 'h3=":443";max=86400';

     ...

}

To apply the settings, restart the service, checking the configuration file for errors using the command:

nginx -t
service nginx restart

You can check the availability of the site, as well as support for the http/3 protocol by your Internet provider, using the following online services:





No Comments Yet