HTTP Working Group | M. Nottingham |
Internet-Draft | Fastly |
Intended status: Standards Track | P. Sikora |
Expires: November 3, 2019 | |
May 2, 2019 |
This document defines the Proxy-Status HTTP header field to convey the details of errors generated by HTTP intermediaries.¶
RFC EDITOR: please remove this section before publication ¶
Discussion of this draft takes place on the HTTP working group mailing list (ietf-http-wg@w3.org), which is archived at https://lists.w3.org/Archives/Public/ietf-http-wg/.¶
Working Group information can be found at https://httpwg.org/; source code and issues list for this draft can be found at https://github.com/httpwg/http-extensions/labels/proxy-status.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress”.¶
This Internet-Draft will expire on November 3, 2019.¶
Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
HTTP intermediaries – including both forward proxies and gateways (also known as “reverse proxies”) – have become an increasingly significant part of HTTP deployments. In particular, reverse proxies and Content Delivery Networks (CDNs) form part of the critical infrastructure of many Web sites.¶
Typically, HTTP intermediaries forward requests towards the origin server and then forward their responses back to clients. However, if an error occurs, the response is generated by the intermediary itself.¶
HTTP accommodates these types of errors with a few status codes; for example, 502 Bad Gateway and 504 Gateway Timeout. However, experience has shown that more information is necessary to aid debugging and communicate what’s happened to the client.¶
To address this, Section 2 defines a new HTTP response header field to convey such information, using the Proxy Status Types defined in Section 3. Section 4 explains how to define new Proxy Status Types.¶
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This specification uses Structured Headers [I-D.ietf-httpbis-header-structure] to specify syntax. The terms sh-param-list, sh-item, sh-string, sh-token and sh-integer refer to the structured types defined therein.¶
Note that in this specification, “proxy” is used to indicate both forward and reverse proxies, otherwise known as gateways. “Next hop” indicates the connection in the direction leading to the origin server for the request.¶
The Proxy-Status HTTP response header field allows an intermediary to indicate the nature and details of an error condition it encounters when servicing a request.¶
It is a Structured Headers [I-D.ietf-httpbis-header-structure] Parameterised List, where each item in the list indicates an error condition. Typically, it will have only one param-item (the error condition that triggered generation of the response it occurs within), but more than one value is not prohibited.¶
Each param-item’s primary-id is a Proxy Status Type, a registered value that indicates the nature of the error.¶
Each param-item can have zero to many parameters. Section 2.1 lists parameters that can be used with all Proxy Status Types; individual types can define additional parameters to use with them. All parameters are optional; see Section 6 for their potential security impact.¶
For example:¶
HTTP/1.1 504 Gateway Timeout Proxy-Status: connection_timeout; proxy=SomeCDN; origin=abc; tries=3
indicates the specific nature of the timeout as a connect timeout to the origin with the identifier “abc”, and that is was generated by the intermediary that identifies itself as “SomeCDN.” Furthermore, three connection attempts were made.¶
Or:¶
HTTP/1.1 429 Too Many Requests Proxy-Status: http_request_error; proxy=SomeReverseProxy
indicates that this 429 Too Many Requests response was generated by the intermediary, not the origin.¶
Each Proxy Status Type has a Recommended HTTP Status Code. When generating a HTTP response containing Proxy-Status, its HTTP status code SHOULD be set to the Recommended HTTP Status Code. However, there may be circumstances (e.g., for backwards compatibility with previous behaviours) when another status code might be used.¶
Section 3 lists the Proxy Status Types defined in this document; new ones can be defined using the procedure outlined in Section 4.¶
Proxy-Status MAY be sent in HTTP trailers, but – as with all trailers – it might be silently discarded along the path to the user agent, this SHOULD NOT be done unless it is not possible to send it in headers. For example, if an intermediary is streaming a response and the upstream connection suddenly terminates, Proxy-Status can be appended to the trailers of the outgoing message (since the headers have already been sent).¶
Note that there are various security considerations for intermediaries using the Proxy-Status header field; see Section 6.¶
Origin servers MUST NOT generate the Proxy-Status header field.¶
This section lists parameters that are potentially applicable to most Proxy Status Types.¶
This section lists the Proxy Status Types defined by this document. See Section 4 for information about defining new Proxy Status Types.¶
New Proxy Status Types can be defined by registering them in the HTTP Proxy Status Types registry.¶
Registration requests are reviewed and approved by a Designated Expert, as per [RFC8126], Section 4.5. A specification document is appreciated, but not required.¶
The Expert(s) should consider the following factors when evaluating requests:¶
Registration requests should use the following template:¶
See the registry at https://iana.org/assignments/http-proxy-statuses for details on where to send registration requests.¶
Upon publication, please create the HTTP Proxy Status Types registry at https://iana.org/assignments/http-proxy-statuses and populate it with the types defined in Section 3; see Section 4 for its associated procedures.¶
One of the primary security concerns when using Proxy-Status is leaking information that might aid an attacker.¶
As a result, care needs to be taken when deciding to generate a Proxy-Status header. Note that intermediaries are not required to generate a Proxy-Status header field in any response, and can conditionally generate them based upon request attributes (e.g., authentication tokens, IP address).¶
Likewise, generation of all parameters is optional.¶
Special care needs to be taken in generating proxy and origin parameters, as they can expose information about the intermediary’s configuration and back-end topology.¶