annotate README @ 8487:6e84524886d4 quic

QUIC: updated README to mention "quic" listen parameter.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 22 Jul 2020 13:45:34 +0300
parents 3c32717d7bb2
children affb0245e291
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
8412
4ea302a47d28 README: update after merging 1.19.0.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8410
diff changeset
18 on nginx mainline 1.19.x. We are planning to merge new nginx
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
19 releases into this branch regularly.
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
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
23 The code is at an early alpha level of quality and should not
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
24 be used in production.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
25
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
26 We are working on improving HTTP/3 support with the goal of
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
27 integrating it to the main NGINX codebase. Expect frequent
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
28 updates of this code and don't rely on it for whatever purpose.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
29
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
30 We'll be grateful for any feedback and code submissions however
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
31 we don't bear any responsibilities for any issues with this code.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
32
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
33 You can always contact us via nginx-devel mailing list [3].
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
34
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
35 What works now:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
36
8449
3c32717d7bb2 README: documented draft-28, draft-29 support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8412
diff changeset
37 Currently we support IETF-QUIC draft-27, draft-28, draft-29.
3c32717d7bb2 README: documented draft-28, draft-29 support.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8412
diff changeset
38 Earlier drafts are NOT supported as they have incompatible wire format.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
39
8410
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
40 You may look at src/event/ngx_event_quic.h for alternative values of the
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
41 NGX_QUIC_DRAFT_VERSION macro used to select IETF draft version number.
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
42
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
43 nginx should be able to respond to simple HTTP/3 requests over QUIC and
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
44 it should be possible to upload and download big files without errors.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
45
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
46 + The handshake completes successfully
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
47 + One endpoint can update keys and its peer responds correctly
8390
70dbd7d0e466 Fixed a typo.
Vladimir Homutov <vl@nginx.com>
parents: 8389
diff changeset
48 + 0-RTT data is being received and acted on
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
49 + 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
50 + A handshake that includes a Retry packet completes successfully
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
51 + Stream data is being exchanged and ACK'ed
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
52 + An H3 transaction succeeded
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
53 + One or both endpoints insert entries into dynamic table and
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
54 subsequently reference them from header blocks
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
55
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
56 Not (yet) supported features:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
57
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
58 - Version negotiation
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
59 - ECN, Congestion control and friends as specified in quic-recovery [5]
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
60 - A connection with the spin bit succeeds and the bit is spinning
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
61 - Structured Logging
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
62 - QUIC recovery (proper congestion and flow control)
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
63 - NAT Rebinding
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
64 - Address Mobility
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
65 - Server push
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
66 - HTTP/3 trailers
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
67
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
68 Since the code is experimental and still under development,
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
69 a lot of things may not work as expected, for example:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
70
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
71 - ACK handling is basic: every received ack-eliciting packet
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
72 is acknowledged, no ack ranges are used
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
73
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
74 - Flow control mechanism is basic and intended to avoid CPU hog and make
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
75 simple interactions possible
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
76
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
77 - Not all draft requirements are strictly followed; some of checks are
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
78 omitted for the sake of simplicity of initial implementation
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
79
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
80 2. Installing
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
81
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
82 You will need a BoringSSL [4] library that provides QUIC support
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
83
8373
796b5b6c43cd Mention quic branch in README.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8372
diff changeset
84 $ hg clone -b quic https://hg.nginx.org/nginx-quic
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
85 $ cd nginx-quic
8372
0e6528551f26 Configure: unbreak with old OpenSSL, --with-http_v3_module added.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8366
diff changeset
86 $ ./auto/configure --with-debug --with-http_v3_module \
0e6528551f26 Configure: unbreak with old OpenSSL, --with-http_v3_module added.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8366
diff changeset
87 --with-cc-opt="-I../boringssl/include" \
0e6528551f26 Configure: unbreak with old OpenSSL, --with-http_v3_module added.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8366
diff changeset
88 --with-ld-opt="-L../boringssl/build/ssl \
0e6528551f26 Configure: unbreak with old OpenSSL, --with-http_v3_module added.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8366
diff changeset
89 -L../boringssl/build/crypto"
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
90 $ make
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
91
8487
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
92 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
93 following new configuration options:
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
94
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
95 --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
96 --with-http_quic_module - enable QUIC for older HTTP versions
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
97 --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
98
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
99 3. Configuration
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
100
8487
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
101 The HTTP "listen" directive got two new options: "http3" and "quic".
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
102 The "http3" option enables HTTP/3 over QUIC on the specified port.
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
103 The "quic" option enables QUIC for older HTTP versions on this port.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
104
8487
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
105 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
106 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
107
6e84524886d4 QUIC: updated README to mention "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents: 8449
diff changeset
108 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
109 option [6] to make it work properly with multiple workers.
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
110
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
111 A number of directives were added that specify transport parameter values:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
112
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
113 quic_max_idle_timeout
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
114 quic_max_ack_delay
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
115 quic_max_packet_size
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
116 quic_initial_max_data
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
117 quic_initial_max_stream_data_bidi_local
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
118 quic_initial_max_stream_data_bidi_remote
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
119 quic_initial_max_stream_data_uni
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
120 quic_initial_max_streams_bidi
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
121 quic_initial_max_streams_uni
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
122 quic_ack_delay_exponent
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
123 quic_active_migration
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
124 quic_active_connection_id_limit
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
125
8402
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
126 To enable address validation:
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
127
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
128 quic_retry on;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
129
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
130 To enable 0-RTT:
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
131
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
132 ssl_early_data on;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
133
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
134 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
135
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
136 ssl_protocols TLSv1.3;
af22b60a905b README: documented Retry, 0-RTT, TLSv1.3 configuration.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8396
diff changeset
137
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
138 Two additional variables are available: $quic and $http3.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
139 The value of $quic is "quic" if QUIC connection is used,
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
140 and empty string otherwise. The value of $http3 is a string
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
141 "h3-xx" where "xx" is the supported draft number.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
142
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
143 Example configuration:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
144
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
145 http {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
146 log_format quic '$remote_addr - $remote_user [$time_local] '
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
147 '"$request" $status $body_bytes_sent '
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
148 '"$http_referer" "$http_user_agent" "$quic" "$http3"';
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
149
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
150 access_log logs/access.log quic;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
151
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
152 server {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
153 # for better compatibility it's recommended
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
154 # to use the same port for quic and https
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
155 listen 8443 http3 reuseport;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
156 listen 8443 ssl;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
157
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
158 ssl_certificate certs/example.com.crt;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
159 ssl_certificate_key certs/example.com.key;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
160 ssl_protocols TLSv1.3;
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
161
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
162 location / {
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
163 # required for browsers to direct them into quic port
8396
94c06fe6e159 README: pointed out Alt-Svc "ma" parameter useful with curl.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8395
diff changeset
164 add_header Alt-Svc '$http3=":8443"; ma=86400';
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
165 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
166 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
167 }
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
168
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
169 4. 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 * Browsers
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
172
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
173 Known to work: Firefox 75+ and Chrome 83+
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
174
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
175 Beware of strange issues: sometimes browser may decide to ignore QUIC
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
176 Cache clearing/restart might help. Always check access.log and
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
177 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
178
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
179 + to enable QUIC in Firefox, set the following in 'about:config':
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
180 network.http.http3.enabled = true
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
181
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
182 + to enable QUIC in Chrome, enable it on command line and force it
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
183 on your site:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
184
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
185 $ ./chrome --enable-quic --quic-version=h3-27 \
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
186 --origin-to-force-quic-on=example.com:8443
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
187
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
188 * Console clients
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
189
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
190 Known to work: ngtcp2, firefox's neqo and chromium's console clients:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
191
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
192 $ examples/client 127.0.0.1 8443 https://example.com:8443/index.html
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
193
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
194 $ ./neqo-client https://127.0.0.1:8443/
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
195
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
196 $ chromium-build/out/my_build/quic_client http://example.com:8443 \
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
197 --quic_version=h3-27 \
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
198 --allow_unknown_root_cert \
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
199 --disable_certificate_verification
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
200
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
201
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
202 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
203
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
204 127.0.0.1 - - [24/Apr/2020:11:27:29 +0300] "GET / HTTP/3" 200 805 "-"
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
205 "nghttp3/ngtcp2 client" "quic" "h3-27"
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
206
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
207
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
208 5. Troubleshooting
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
209
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
210 Here are some tips that may help you to identify problems:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
211
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
212 + Ensure you are building with proper SSL library that
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
213 implements draft 27
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
214
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
215 + Ensure you are using the proper SSL library in runtime
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
216 (`nginx -V` will show you what you are using)
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
217
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
218 + Ensure your client is actually sending QUIC requests
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
219 (see "Clients" section about browsers and cache)
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
220
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
221 We recommend to start with simple console client like ngtcp2
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
222 to ensure you've got server configured properly before trying
8395
578563babbd1 Fixed a typo.
Vladimir Homutov <vl@nginx.com>
parents: 8390
diff changeset
223 with real browsers that may be very picky with certificates,
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
224 for example.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
225
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
226 + Build nginx with debug support [7] and check your debug log.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
227 It should contain all details about connection and why it
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
228 failed. All related messages contain "quic " prefix and can
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
229 be easily filtered out.
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
230
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
231 + If you want to investigate deeper, you may want to enable
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
232 additional debugging in src/event/ngx_event_quic.h:
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
233
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
234 #define NGX_QUIC_DEBUG_PACKETS
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
235 #define NGX_QUIC_DEBUG_FRAMES
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
236 #define NGX_QUIC_DEBUG_FRAMES_ALLOC
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
237 #define NGX_QUIC_DEBUG_CRYPTO
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
238
8410
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
239 6. Contributing
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
240
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
241 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
242 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
243
c7d1b500bd0a Updated README with "Contributing" section and draft details.
Vladimir Homutov <vl@nginx.com>
parents: 8402
diff changeset
244 7. Links
8366
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
245
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
246 [1] https://tools.ietf.org/html/draft-ietf-quic-transport-27
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
247 [2] https://tools.ietf.org/html/draft-ietf-quic-http-27
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
248 [3] https://mailman.nginx.org/mailman/listinfo/nginx-devel
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
249 [4] https://boringssl.googlesource.com/boringssl/
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
250 [5] https://tools.ietf.org/html/draft-ietf-quic-recovery-27
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
251 [6] https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
3e894ace66ee Added README.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
252 [7] https://nginx.org/en/docs/debugging_log.html