comparison src/http/ngx_http_request.h @ 6556:654d2dae97d3

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.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 20 May 2016 18:41:17 +0300
parents 055cbb52ac1d
children e8d4c9e9682a
comparison
equal deleted inserted replaced
6555:090a78da4f88 6556:654d2dae97d3
93 #define NGX_HTTP_PRECONDITION_FAILED 412 93 #define NGX_HTTP_PRECONDITION_FAILED 412
94 #define NGX_HTTP_REQUEST_ENTITY_TOO_LARGE 413 94 #define NGX_HTTP_REQUEST_ENTITY_TOO_LARGE 413
95 #define NGX_HTTP_REQUEST_URI_TOO_LARGE 414 95 #define NGX_HTTP_REQUEST_URI_TOO_LARGE 414
96 #define NGX_HTTP_UNSUPPORTED_MEDIA_TYPE 415 96 #define NGX_HTTP_UNSUPPORTED_MEDIA_TYPE 415
97 #define NGX_HTTP_RANGE_NOT_SATISFIABLE 416 97 #define NGX_HTTP_RANGE_NOT_SATISFIABLE 416
98 #define NGX_HTTP_MISDIRECTED_REQUEST 421
98 99
99 100
100 /* Our own HTTP codes */ 101 /* Our own HTTP codes */
101 102
102 /* The special code to close connection without any response */ 103 /* The special code to close connection without any response */