When I specified Nginx to work in a multi-process manner, the HTTP3 request would report an error. What i can sure is, when start Nginx with single worker process it can work successfully.
I'am not sure whether the problem is related to SO_REUSPORT on MAC can only send the dataframe to socket with round-robin method, which can not support session affinity.
My Nginx configuration is as follows:
worker_processes 10;
# ... omit other config
server {
listen 443 ssl;
listen 443 quic reuseport;
http2 on;
quic_retry on;
add_header alt-svc 'h3=":443"; ma=2592000';
add_header x-quic 'h3';
server_name www.example.org;
ssl_certificate www.example.org.pem;
ssl_certificate_key www.example.org.key;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1.3;
location / {
return 200 "helloworld";
}
}
The HTTP3 test result is:
curl --http3 https://127.0.0.1:443 -vk
* Trying 127.0.0.1:443...
* Server certificate:
* subject: C=US; ST=CA; O=Some organization; CN=www.example.org
* start date: May 13 09:16:20 2024 GMT
* expire date: May 13 09:16:20 2025 GMT
* issuer: C=US; ST=TX; O=Some CA organization; CN=www.example.com
* SSL certificate verify result: self-signed certificate in certificate chain (19), continuing anyway.
* Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Connected to 127.0.0.1 (127.0.0.1) port 443
* using HTTP/3
* [HTTP/3] [0] OPENED stream for https://127.0.0.1:443/
* [HTTP/3] [0] [:method: GET]
* [HTTP/3] [0] [:scheme: https]
* [HTTP/3] [0] [:authority: 127.0.0.1]
* [HTTP/3] [0] [:path: /]
* [HTTP/3] [0] [user-agent: curl/8.14.0]
* [HTTP/3] [0] [accept: */*]
> GET / HTTP/3
> Host: 127.0.0.1
> User-Agent: curl/8.14.0
> Accept: */*
>
* Request completely sent off
* QUIC connection has been shut down
* Connection #0 to host 127.0.0.1 left intact
curl: (56) QUIC connection has been shut down
I have tried to start Nginx in the single-process mode and it could run successfully.