http3
The http3 directive enables support for the HTTP/3 protocol in NGINX.
Description
The http3 directive allows NGINX to support the HTTP/3 protocol, which is the third major version of the Hypertext Transfer Protocol. HTTP/3 is built on top of QUIC, a transport layer network protocol originally developed by Google. This directive, by being set to 'on', enables the server to handle requests using HTTP/3, leveraging stream multiplexing and improved performance over traditional HTTP/2 and HTTP/1.1 protocols. When enabled, NGINX communicates with clients that support HTTP/3, providing them with the benefits of reduced latency and increased connection resilience due to QUIC's unique features such as 0RTT connection establishment and better handling of packet loss.
The directive can be placed in both the http and server contexts, allowing for configuration at a global or server-specific level. By setting this directive as 'on', the server will attempt to use HTTP/3 for supported clients while still being able to serve others using older protocols. This makes transitioning to newer protocol versions smoother without completely discontinuing support for existing protocols. Additionally, proper TLS/SSL configuration is required as HTTP/3 is reliant on encrypted connections, so it is essential to set up the appropriate certificates before deploying this directive.
Config Example
server {
listen 443 ssl;
http3 on;
ssl_certificate /etc/nginx/ssl/example.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
}
Ensure that QUIC is properly enabled on the server and that necessary ports are open (typically UDP 443).
Make sure to configure SSL certificates properly, as HTTP/3 requires encrypted connections.
Check that your clients support HTTP/3, as older clients will fall back to HTTP/2 or HTTP/1.1.