comparison README @ 8489:f0882db8c8d4 quic

HTTP/3: removed $http3 that served its purpose. To specify final protocol version by hand: add_header Alt-Svc h3=":443";
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 31 May 2021 11:54:47 +0300
parents 8422570f6af4
children d56c7c4b66fd
comparison
equal deleted inserted replaced
8488:8422570f6af4 8489:f0882db8c8d4
133 http3_max_blocked_streams 133 http3_max_blocked_streams
134 http3_max_concurrent_pushes 134 http3_max_concurrent_pushes
135 http3_push 135 http3_push
136 http3_push_preload 136 http3_push_preload
137 137
138 Two additional variables are available: $quic and $http3. 138 An additional variable is available: $quic.
139 The value of $quic is "quic" if QUIC connection is used, 139 The value of $quic is "quic" if QUIC connection is used,
140 and empty string otherwise. The value of $http3 is a string 140 or an empty string otherwise.
141 "h3-xx" where "xx" is the supported draft number.
142 141
143 Example configuration: 142 Example configuration:
144 143
145 http { 144 http {
146 log_format quic '$remote_addr - $remote_user [$time_local] ' 145 log_format quic '$remote_addr - $remote_user [$time_local] '
147 '"$request" $status $body_bytes_sent ' 146 '"$request" $status $body_bytes_sent '
148 '"$http_referer" "$http_user_agent" "$quic" "$http3"'; 147 '"$http_referer" "$http_user_agent" "$quic"';
149 148
150 access_log logs/access.log quic; 149 access_log logs/access.log quic;
151 150
152 server { 151 server {
153 # for better compatibility it's recommended 152 # for better compatibility it's recommended
159 ssl_certificate_key certs/example.com.key; 158 ssl_certificate_key certs/example.com.key;
160 ssl_protocols TLSv1.3; 159 ssl_protocols TLSv1.3;
161 160
162 location / { 161 location / {
163 # required for browsers to direct them into quic port 162 # required for browsers to direct them into quic port
164 add_header Alt-Svc '$http3=":8443"; ma=86400'; 163 add_header Alt-Svc 'h3=":8443"; ma=86400';
165 } 164 }
166 } 165 }
167 } 166 }
168 167
169 4. Clients 168 4. Clients
200 199
201 200
202 If you've got it right, in the access log you should see something like: 201 If you've got it right, in the access log you should see something like:
203 202
204 127.0.0.1 - - [24/Apr/2020:11:27:29 +0300] "GET / HTTP/3" 200 805 "-" 203 127.0.0.1 - - [24/Apr/2020:11:27:29 +0300] "GET / HTTP/3" 200 805 "-"
205 "nghttp3/ngtcp2 client" "quic" "h3-29" 204 "nghttp3/ngtcp2 client" "quic"
206 205
207 206
208 5. Troubleshooting 207 5. Troubleshooting
209 208
210 Here are some tips that may help you to identify problems: 209 Here are some tips that may help you to identify problems: