1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
=encoding utf-8
=head1 Name
quic - Support for QUIC and HTTP/3
=head1
Support for
L<QUIC|https://datatracker.ietf.org/doc/html/rfc9000>
and
L<HTTPE<sol>3|https://datatracker.ietf.org/doc/html/rfc9114>
protocols is available since 1.25.0.
Also, since 1.25.0, the QUIC and HTTPE<sol>3 support is available in
Linux L<binary packages|linux_packages>.
B<NOTE>
The QUIC and HTTPE<sol>3 support is experimental, caveat emptor applies.
=head1 Building from sources
The build is configured using the C<configure> command.
Please refer to L<configure> for details.
When configuring nginx, it is possible to enable QUIC and HTTPE<sol>3 using the
L<C<--with-http_v3_module>|configure>
configuration parameter.
An SSL library that provides QUIC support is recommended to build nginx, such as
L<BoringSSL|https://boringssl.googlesource.com/boringssl>,
L<LibreSSL|https://www.libressl.org>, or
L<QuicTLS|https://github.com/quictls/openssl>.
Otherwise, the L<OpenSSL|https://openssl.org>
compatibility layer will be used that does not support
L<early data|ngx_http_ssl_module>.
Use the following command to configure nginx with
L<BoringSSL|https://boringssl.googlesource.com/boringssl>:
./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../boringssl/include"
--with-ld-opt="-L../boringssl/build/ssl
-L../boringssl/build/crypto"
Alternatively, nginx can be configured with
L<QuicTLS|https://github.com/quictls/openssl>:
./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../quictls/build/include"
--with-ld-opt="-L../quictls/build/lib"
Alternatively, nginx can be configured with a modern version of
L<LibreSSL|https://www.libressl.org>:
./configure
--with-debug
--with-http_v3_module
--with-cc-opt="-I../libressl/build/include"
--with-ld-opt="-L../libressl/build/lib"
After configuration,
nginx is compiled and installed using C<make>.
=head1 Configuration
The L<ngx_http_core_module> directive in
L<ngx_http_core_module|ngx_http_core_module>
module got a new parameter
L<quic|ngx_http_core_module>
which enables HTTPE<sol>3 over QUIC on the specified port.
Along with the C<quic> parameter
it is also possible to specify the
L<reuseport|ngx_http_core_module>
parameter to make it work properly with multiple workers.
For the list of directives, see
L<ngx_http_v3_module|ngx_http_v3_module>.
To L<enable|ngx_http_v3_module>
address validation:
quic_retry on;
To L<enable|ngx_http_ssl_module>
0-RTT:
ssl_early_data on;
To L<enable|ngx_http_v3_module>
GSO (Generic Segmentation Offloading):
quic_gso on;
To L<set|ngx_http_v3_module>
host key for various tokens:
quic_host_key <filename>;
QUIC requires TLSv1.3 protocol version which is enabled by default
in the L<ngx_http_ssl_module> directive.
By default,
L<GSO Linux-specific optimization|http://vger.kernel.org/lpc_net2018_talks/willemdebruijn-lpc2018-udpgso-paper-DRAFT-1.pdf>
is disabled.
Enable it in case a corresponding network interface is configured
to support GSO.
=head1 Example Configuration
http {
log_format quic '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http3"';
access_log logs/access.log quic;
server {
# for better compatibility it's recommended
# to use the same port for quic and https
listen 8443 quic reuseport;
listen 8443 ssl;
ssl_certificate certs/example.com.crt;
ssl_certificate_key certs/example.com.key;
location / {
# required for browsers to direct them to quic port
add_header Alt-Svc 'h3=":8443"; ma=86400';
}
}
}
=head1 Troubleshooting
Tips that may help to identify problems:
=over
=item *
Ensure nginx is built with the proper SSL library.
=item *
Ensure nginx is using the proper SSL library in runtime
(the C<nginx -V> shows what it is currently used).
=item *
Ensure a client is actually sending requests over QUIC.
It is recommended to start with a simple console client such as
L<ngtcp2|https://nghttp2.org/ngtcp2>
to ensure the server is configured properly before trying
with real browsers that may be quite picky with certificates.
=item *
Build nginx with L<debug support|debugging_log>
and check the debug log.
It should contain all details about the connection and why it failed.
All related messages contain the “C<quic>” prefix
and can be easily filtered out.
=item *
For a deeper investigation, additional debugging can be enabled
using the following macros:
C<NGX_QUIC_DEBUG_PACKETS>,
C<NGX_QUIC_DEBUG_FRAMES>,
C<NGX_QUIC_DEBUG_ALLOC>,
C<NGX_QUIC_DEBUG_CRYPTO>.
./configure
--with-http_v3_module
--with-debug
--with-cc-opt="-DNGX_QUIC_DEBUG_PACKETS -DNGX_QUIC_DEBUG_CRYPTO"
=back
|