Possible to make preread work for QUIC?

My issue:

I’m experimenting load balancing for a bunch of upstream QUIC servers.
I wonder if nginx is the right tool for this?

I tried the stream module with the ssl_preread on directive.

How I encountered the problem:

when doing curl --http3-only quic2.com, nginx seemed to always send the traffic to the default upstream [::1]:444.

Solutions I’ve tried:

Version of NGINX or NGINX adjacent software (e.g. NGINX Gateway Fabric):

1.27.5

Deployment environment:

Minimal NGINX config to reproduce your issue

pid /run/nginx/nginx.pid;
error_log stderr;
daemon off;
events {}
stream {
map $ssl_preread_server_name $upstream {
default [::1]:444;
quic1.com unix:/run/nginx/quic1.sock;
quic2.com unix:/run/nginx/quic2.sock;
}
server {
listen 443 reuseport;
listen [::]:443 reuseport;
ssl_preread on;
proxy_pass $upstream;
}
server {
listen 443 udp reuseport;
listen [::]:443 udp reuseport;
ssl_preread on;
proxy_pass $upstream;
}
}

NGINX access/error log: (Tip → You can usually find the logs in the /var/log/nginx directory.)