diff options
author | Valentin Bartenev <vbart@nginx.com> | 2016-05-20 18:41:17 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2016-05-20 18:41:17 +0300 |
commit | f7673bb50f758cb421ca3a5186c49292a85d08ae (patch) | |
tree | 3e9ab99d2a56465105f03775de56edaf28e2448e /src/http/ngx_http_request.h | |
parent | 61fbcd1cad8b2ba3f160c64ed8ddb3f19a11bd9c (diff) | |
download | nginx-f7673bb50f758cb421ca3a5186c49292a85d08ae.tar.gz nginx-f7673bb50f758cb421ca3a5186c49292a85d08ae.zip |
HTTP/2: the "421 Misdirected Request" response (closes #848).
Since 4fbef397c753 nginx rejects with the 400 error any attempts of
requesting different host over the same connection, if the relevant
virtual server requires verification of a client certificate.
While requesting hosts other than negotiated isn't something legal
in HTTP/1.x, the HTTP/2 specification explicitly permits such requests
for connection reuse and has introduced a special response code 421.
According to RFC 7540 Section 9.1.2 this code can be sent by a server
that is not configured to produce responses for the combination of
scheme and authority that are included in the request URI. And the
client may retry the request over a different connection.
Now this code is used for requests that aren't authorized in current
connection. After receiving the 421 response a client will be able
to open a new connection, provide the required certificate and retry
the request.
Unfortunately, not all clients currently are able to handle it well.
Notably Chrome just shows an error, while at least the latest version
of Firefox retries the request over a new connection.
Diffstat (limited to 'src/http/ngx_http_request.h')
-rw-r--r-- | src/http/ngx_http_request.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index fcd50de45..499c1eff5 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -95,6 +95,7 @@ #define NGX_HTTP_REQUEST_URI_TOO_LARGE 414 #define NGX_HTTP_UNSUPPORTED_MEDIA_TYPE 415 #define NGX_HTTP_RANGE_NOT_SATISFIABLE 416 +#define NGX_HTTP_MISDIRECTED_REQUEST 421 /* Our own HTTP codes */ |