Nginx version 1.26.0 http3

dpnmw

Verified User
Joined
Dec 6, 2023
Messages
7
Hi, I would like to know how can I edit the nginx server block to enable http3 support if possible
 
Hi, I've done both of this however I have apache+nginx reverse proxy running with a custom template as default.

I've added nginx=0 to a domain conf options to disable reverse proxy for this domain but now the domain doesn't show it's site but the default server "webserver is functioning normally".

This is the nginx-vhost.conf server block

Code:
# HTTPS server
    #
    server {
        listen       |IP|:|PORT_443| ssl;
        listen       127.0.0.1:|PORT_443| ssl;
        listen       [::1]:|PORT_443| ssl;
        listen       |IP|:|PORT_443| quic;
        listen       [::1]:|PORT_443| quic;
        http2 on;
        http3 on;
 
Was http/3 not enabled by default since NGINX 1.25?

Support for QUIC and HTTP/3 protocols is available since 1.25.0. Also, since 1.25.0, the QUIC and HTTP/3 support is available in Linux binary packages.

But directadmin does not compile NGINX with its support, and NGINX will produce an emergency error:

Bash:
[[email protected] nginx]# nginx -t
nginx: [emerg] unknown directive "http3" in /etc/nginx/nginx-vhosts.conf:44
nginx: configuration file /etc/nginx/nginx.conf test failed
[[email protected] nginx]#

if you try to enable HTTP/3 without re-compiling the NGINX.
 
And as soon as I re-compile NGINX with:

Bash:
[[email protected] nginx_reverse]# grep -C 2 'with-http_v3_module' /usr/local/directadmin/custombuild/custom/nginx_reverse/configure.nginx
    "--with-http_dav_module" \
    "--with-http_v2_module" \
    "--with-http_v3_module" \
    "--with-http_image_filter_module" ${WITH_OPENSSL} \
    "--add-module=../ngx_cache_purge" \
[[email protected] nginx_reverse]#

I can enable http3:

Bash:
[[email protected] nginx_reverse]# grep http3 /etc/nginx/nginx-vhosts.conf -C 1
        http2 on;
        http3 on;

[[email protected] nginx_reverse]#
 
And as soon as I re-compile NGINX with:

Bash:
[[email protected] nginx_reverse]# grep -C 2 'with-http_v3_module' /usr/local/directadmin/custombuild/custom/nginx_reverse/configure.nginx
    "--with-http_dav_module" \
    "--with-http_v2_module" \
    "--with-http_v3_module" \
    "--with-http_image_filter_module" ${WITH_OPENSSL} \
    "--add-module=../ngx_cache_purge" \
[[email protected] nginx_reverse]#

I can enable http3:

Bash:
[[email protected] nginx_reverse]# grep http3 /etc/nginx/nginx-vhosts.conf -C 1
        http2 on;
        http3 on;

[[email protected] nginx_reverse]#

Hi does this work and are you able to see http3 is enabled?
 
Ensure you not use in world wild server because...from nginx official site said
The QUIC and HTTP/3 support is experimental, caveat emptor applies.
 
And as soon as I re-compile NGINX with:

Bash:
[[email protected] nginx_reverse]# grep -C 2 'with-http_v3_module' /usr/local/directadmin/custombuild/custom/nginx_reverse/configure.nginx
    "--with-http_dav_module" \
    "--with-http_v2_module" \
    "--with-http_v3_module" \
    "--with-http_image_filter_module" ${WITH_OPENSSL} \
    "--add-module=../ngx_cache_purge" \
[[email protected] nginx_reverse]#

I can enable http3:

Bash:
[[email protected] nginx_reverse]# grep http3 /etc/nginx/nginx-vhosts.conf -C 1
        http2 on;
        http3 on;

[[email protected] nginx_reverse]#

This is my nginx config output

Code:
nginx version: nginx/1.26.0
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/usr --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --http-log-path=/var/log/nginx/access_log --error-log-path=/var/log/nginx/error_log --without-mail_imap_module --without-mail_smtp_module --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_dav_module --with-http_v2_module --with-http_v3_module --add-module=../ngx_cache_purge --with-cc-opt=''-D FD_SETSIZE=32768''
 
Do you manually add http3 on; to the nginx config?

My intention was to test the process of adding http/3 support. So I just modified a file /etc/nginx/nginx-vhosts.conf. I don't need it to be enabled for longer time. If you need to be enabled constantly you will need to modify templates.
 
Do you manually add http3 on; to the nginx config? Or with template system? I want to test it out but the template system doesn't have this yet if I'm correct to add that line below http2 on;
It should be listen |IP|:|PORT_443| quic reuseport; not http3 on;
 
Back
Top