annotate README @ 9032:41796b6804d9 quic

QUIC: support for setting QUIC methods with LibreSSL. Setting QUIC methods is converted to use C99 designated initializers for simplicity, as LibreSSL 3.6.0 has different SSL_QUIC_METHOD layout. Additionally, only set_read_secret/set_write_secret callbacks are set. Although they are preferred in LibreSSL over set_encryption_secrets, better be on a safe side as LibreSSL has unexpectedly incompatible set_encryption_secrets calling convention expressed in passing read and write secrets split in separate calls, unlike this is documented in old BoringSSL sources. To avoid introducing further changes for the old API, it is simply disabled.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 20 Oct 2022 16:21:06 +0400
parents 98e94553ae51
children 79cd6993a3e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
1 Experimental QUIC support for nginx
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
2 -----------------------------------
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
3
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
4 1. Introduction
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
5 2. Installing
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
6 3. Configuration
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
7 4. Clients
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
8 5. Troubleshooting
8410
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
9 6. Contributing
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
10 7. Links
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
11
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
12 1. Introduction
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
13
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
14 This is an experimental QUIC [1] / HTTP/3 [2] support for nginx.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
15
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
16 The code is developed in a separate "quic" branch available
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
17 at https://hg.nginx.org/nginx-quic. Currently it is based
9021
8d0753760546 Merged with the default branch.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9019
diff changeset
18 on nginx mainline 1.23.x. We merge new nginx releases into
8601
dd8e50e11bfc QUIC: updated README.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8547
diff changeset
19 this branch regularly.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
20
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
21 The project code base is under the same BSD license as nginx.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
22
9028
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
23 The code is currently at a beta level of quality, however
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
24 there are several production deployments with it.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
25
9028
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
26 We are working on improving HTTP/3 support to integrate it into
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
27 the main NGINX codebase. Thus, expect further updates of this code,
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
28 including features, changes in behaviour, bug fixes, and refactoring.
98e94553ae51 README: updated the current status.
Sergey Kandaurov <pluknet@nginx.com>
parents: 9021
diff changeset
29 We'll be grateful for any feedback and code submissions.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
30
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
31 You can always contact us via nginx-devel mailing list [3].
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
32
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
33 What works now:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
34
8982
8f5d0ade0da7 README: updated to QUICv1.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8966
diff changeset
35 We support IETF QUIC version 1. Internet drafts are no longer supported.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
36
8601
dd8e50e11bfc QUIC: updated README.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8547
diff changeset
37 nginx should be able to respond to HTTP/3 requests over QUIC and
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
38 it should be possible to upload and download big files without errors.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
39
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
40 + The handshake completes successfully
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
41 + One endpoint can update keys and its peer responds correctly
8390
70dbd7d0e466 Fixed a typo.
Vladimir Homutov <vl@nginx.com>
parents: 8389
diff changeset
42 + 0-RTT data is being received and acted on
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
43 + Connection is established using TLS Resume Ticket
8389
2b580ac17a47 README: Retry support, protocol error messages implemented.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8373
diff changeset
44 + A handshake that includes a Retry packet completes successfully
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
45 + Stream data is being exchanged and ACK'ed
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
46 + An H3 transaction succeeded
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
47 + One or both endpoints insert entries into dynamic table and
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
48 subsequently reference them from header blocks
8527
cec7f207a4bf QUIC: updated README.
Vladimir Homutov <vl@nginx.com>
parents: 8498
diff changeset
49 + Version Negotiation packet is sent to client with unknown version
cec7f207a4bf QUIC: updated README.
Vladimir Homutov <vl@nginx.com>
parents: 8498
diff changeset
50 + Lost packets are detected and retransmitted properly
8763
4117aa7fa38e QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents: 8747
diff changeset
51 + Clients may migrate to new address
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
52
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
53 2. Installing
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
54
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
55 You will need a BoringSSL [4] library that provides QUIC support
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
56
8373
796b5b6c43cd Mention quic branch in README.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8372
diff changeset
57 $ hg clone -b quic https://hg.nginx.org/nginx-quic
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
58 $ cd nginx-quic
8966
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
59 $ ./auto/configure --with-debug --with-http_v3_module \
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
60 --with-cc-opt="-I../boringssl/include" \
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
61 --with-ld-opt="-L../boringssl/build/ssl \
8372
0e6528551f26 Configure: unbreak with old OpenSSL, --with-http_v3_module added.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8366
diff changeset
62 -L../boringssl/build/crypto"
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
63 $ make
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
64
9019
0e74a77c2475 README: updated after HTTP/3 RFC publication, minor refinements.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8984
diff changeset
65 Alternatively, nginx can be configured with QuicTLS [5]
8966
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
66
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
67 $ ./auto/configure --with-debug --with-http_v3_module \
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
68 --with-cc-opt="-I../quictls/build/include" \
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
69 --with-ld-opt="-L../quictls/build/lib"
6f8253673669 README: documented QuicTLS support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8929
diff changeset
70
8487
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
71 When configuring nginx, you can enable QUIC and HTTP/3 using the
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
72 following new configuration options:
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
73
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
74 --with-http_v3_module - enable QUIC and HTTP/3
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
75 --with-stream_quic_module - enable QUIC in Stream
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
76
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
77 3. Configuration
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
78
8922
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8840
diff changeset
79 The HTTP "listen" directive got a new option "http3" which enables
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8840
diff changeset
80 HTTP/3 over QUIC on the specified port.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
81
8487
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
82 The Stream "listen" directive got a new option "quic" which enables
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
83 QUIC as client transport protocol instead of TCP or plain UDP.
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
84
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
85 Along with "http3" or "quic", you also have to specify "reuseport"
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
86 option [6] to make it work properly with multiple workers.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
87
8402
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
88 To enable address validation:
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
89
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
90 quic_retry on;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
91
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
92 To enable 0-RTT:
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
93
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
94 ssl_early_data on;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
95
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
96 Make sure that TLS 1.3 is configured which is required for QUIC:
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
97
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
98 ssl_protocols TLSv1.3;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
99
8819
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
100 To enable GSO (Generic Segmentation Offloading):
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
101
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
102 quic_gso on;
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
103
9019
0e74a77c2475 README: updated after HTTP/3 RFC publication, minor refinements.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8984
diff changeset
104 To limit maximum UDP payload size on receive path:
8924
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
105
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
106 quic_mtu <size>;
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
107
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
108 To set host key for various tokens:
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
109
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
110 quic_host_key <filename>;
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
111
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
112
9019
0e74a77c2475 README: updated after HTTP/3 RFC publication, minor refinements.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8984
diff changeset
113 By default, GSO Linux-specific optimization [8] is disabled.
8819
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
114 Enable if your network interface is configured to support GSO.
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
115
8498
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
116 A number of directives were added that configure HTTP/3:
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
117
8924
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
118 http3_stream_buffer_size
8498
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
119 http3_max_concurrent_pushes
8924
d6ef13c5fd8e QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents: 8923
diff changeset
120 http3_max_concurrent_streams
8498
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
121 http3_push
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
122 http3_push_preload
8922
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8840
diff changeset
123 http3_hq (requires NGX_HTTP_V3_HQ macro)
8498
affb0245e291 QUIC: added HTTP/3 directives list to README.
Roman Arutyunyan <arut@nginx.com>
parents: 8487
diff changeset
124
8923
651cc905b7c2 HTTP/3: $http3 variable.
Roman Arutyunyan <arut@nginx.com>
parents: 8922
diff changeset
125 In http, an additional variable is available: $http3.
651cc905b7c2 HTTP/3: $http3 variable.
Roman Arutyunyan <arut@nginx.com>
parents: 8922
diff changeset
126 The value of $http3 is "h3" for HTTP/3 connections,
651cc905b7c2 HTTP/3: $http3 variable.
Roman Arutyunyan <arut@nginx.com>
parents: 8922
diff changeset
127 "hq" for hq connections, or an empty string otherwise.
651cc905b7c2 HTTP/3: $http3 variable.
Roman Arutyunyan <arut@nginx.com>
parents: 8922
diff changeset
128
651cc905b7c2 HTTP/3: $http3 variable.
Roman Arutyunyan <arut@nginx.com>
parents: 8922
diff changeset
129 In stream, an additional variable is available: $quic.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
130 The value of $quic is "quic" if QUIC connection is used,
8788
f0882db8c8d4 HTTP/3: removed $http3 that served its purpose.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8787
diff changeset
131 or an empty string otherwise.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
132
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
133 Example configuration:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
134
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
135 http {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
136 log_format quic '$remote_addr - $remote_user [$time_local] '
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
137 '"$request" $status $body_bytes_sent '
8929
44553428288d QUIC: updated README.
Vladimir Homutov <vl@nginx.com>
parents: 8924
diff changeset
138 '"$http_referer" "$http_user_agent" "$http3"';
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
139
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
140 access_log logs/access.log quic;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
141
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
142 server {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
143 # for better compatibility it's recommended
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
144 # to use the same port for quic and https
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
145 listen 8443 http3 reuseport;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
146 listen 8443 ssl;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
147
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
148 ssl_certificate certs/example.com.crt;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
149 ssl_certificate_key certs/example.com.key;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
150 ssl_protocols TLSv1.3;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
151
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
152 location / {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
153 # required for browsers to direct them into quic port
8788
f0882db8c8d4 HTTP/3: removed $http3 that served its purpose.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8787
diff changeset
154 add_header Alt-Svc 'h3=":8443"; ma=86400';
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
155 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
156 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
157 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
158
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
159 4. Clients
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
160
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
161 * Browsers
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
162
8982
8f5d0ade0da7 README: updated to QUICv1.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8966
diff changeset
163 Known to work: Firefox 90+ and Chrome 92+ (QUIC version 1)
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
164
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
165 Beware of strange issues: sometimes browser may decide to ignore QUIC
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
166 Cache clearing/restart might help. Always check access.log and
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
167 error.log to make sure you are using HTTP/3 and not TCP https.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
168
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
169 * Console clients
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
170
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
171 Known to work: ngtcp2, firefox's neqo and chromium's console clients:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
172
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
173 $ examples/client 127.0.0.1 8443 https://example.com:8443/index.html
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
174
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
175 $ ./neqo-client https://127.0.0.1:8443/
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
176
8982
8f5d0ade0da7 README: updated to QUICv1.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8966
diff changeset
177 $ chromium-build/out/my_build/quic_client http://example.com:8443
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
178
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
179
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
180 If you've got it right, in the access log you should see something like:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
181
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
182 127.0.0.1 - - [24/Apr/2020:11:27:29 +0300] "GET / HTTP/3" 200 805 "-"
8788
f0882db8c8d4 HTTP/3: removed $http3 that served its purpose.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8787
diff changeset
183 "nghttp3/ngtcp2 client" "quic"
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
184
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
185
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
186 5. Troubleshooting
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
187
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
188 Here are some tips that may help you to identify problems:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
189
8601
dd8e50e11bfc QUIC: updated README.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8547
diff changeset
190 + Ensure you are building with proper SSL library that supports QUIC
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
191
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
192 + Ensure you are using the proper SSL library in runtime
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
193 (`nginx -V` will show you what you are using)
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
194
8982
8f5d0ade0da7 README: updated to QUICv1.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8966
diff changeset
195 + Ensure your client is actually sending requests over QUIC
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
196 (see "Clients" section about browsers and cache)
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
197
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
198 We recommend to start with simple console client like ngtcp2
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
199 to ensure you've got server configured properly before trying
8395
578563babbd1 Fixed a typo.
Vladimir Homutov <vl@nginx.com>
parents: 8390
diff changeset
200 with real browsers that may be very picky with certificates,
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
201 for example.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
202
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
203 + Build nginx with debug support [7] and check your debug log.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
204 It should contain all details about connection and why it
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
205 failed. All related messages contain "quic " prefix and can
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
206 be easily filtered out.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
207
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
208 + If you want to investigate deeper, you may want to enable
8804
d56c7c4b66fd README: updated path after moving QUIC sources.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8788
diff changeset
209 additional debugging in src/event/quic/ngx_event_quic_connection.h:
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
210
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
211 #define NGX_QUIC_DEBUG_PACKETS
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
212 #define NGX_QUIC_DEBUG_FRAMES
8657
2dfc5ef29973 QUIC: introduced QUIC buffers.
Roman Arutyunyan <arut@nginx.com>
parents: 8601
diff changeset
213 #define NGX_QUIC_DEBUG_ALLOC
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
214 #define NGX_QUIC_DEBUG_CRYPTO
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
215
8410
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
216 6. Contributing
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
217
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
218 If you are willing to contribute, please refer to
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
219 http://nginx.org/en/docs/contributing_changes.html
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
220
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
221 7. Links
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
222
8787
8422570f6af4 README: updated after QUIC RFC publication, nginx 1.21 rebase.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8763
diff changeset
223 [1] https://datatracker.ietf.org/doc/html/rfc9000
9019
0e74a77c2475 README: updated after HTTP/3 RFC publication, minor refinements.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8984
diff changeset
224 [2] https://datatracker.ietf.org/doc/html/rfc9114
8984
a7b789e2be27 README: updated link to nginx-devel mailman.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8983
diff changeset
225 [3] https://mailman.nginx.org/mailman3/lists/nginx-devel.nginx.org/
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
226 [4] https://boringssl.googlesource.com/boringssl/
9019
0e74a77c2475 README: updated after HTTP/3 RFC publication, minor refinements.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8984
diff changeset
227 [5] https://github.com/quictls/openssl
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
228 [6] https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
229 [7] https://nginx.org/en/docs/debugging_log.html
8819
d0ef43a53a51 QUIC: updated README with GSO details.
Vladimir Homutov <vl@nginx.com>
parents: 8804
diff changeset
230 [8] http://vger.kernel.org/lpc_net2018_talks/willemdebruijn-lpc2018-udpgso-paper-DRAFT-1.pdf