<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.5.8 -->
<?rfc-ext html-pretty-print="prettyprint https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"?>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext"
     category="std"
     docName="draft-ietf-httpbis-proxy-status-07"
     ipr="trust200902"
     submissionType="IETF">
   <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22\&amp;amp;body=%3c{ref}%3e:"/>
   <front>
      <title abbrev="Proxy-Status Header">The Proxy-Status HTTP Response Header Field</title>
      <author fullname="Mark Nottingham" initials="M." surname="Nottingham">
         <organization>Fastly</organization>
         <address>
            <postal>
               <postalLine>Prahran</postalLine>
               <postalLine>Australia</postalLine>
            </postal>
            <email>mnot@mnot.net</email>
            <uri>https://www.mnot.net/</uri>
         </address>
      </author>
      <author fullname="Piotr Sikora" initials="P." surname="Sikora">
         <organization>Google</organization>
         <address>
            <email>piotrsikora@google.com</email>
         </address>
      </author>
      <date year="2021" month="October" day="10"/>
      <area>Applications and Real-Time</area>
      <workgroup>HTTP</workgroup>
      <keyword>Internet-Draft</keyword>
      <abstract>
         <t>This document defines the Proxy-Status HTTP field to convey the details of intermediary response handling, including generated errors.</t>
      </abstract>
      <note title="Note to Readers">
         <t>
            <em>RFC EDITOR: please remove this section before publication</em>
         </t>
         <t>Discussion of this draft takes place on the HTTP working group mailing list (ietf-http-wg@w3.org), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/">https://lists.w3.org/Archives/Public/ietf-http-wg/</eref>.</t>
         <t>Working Group information can be found at <eref target="https://httpwg.org/">https://httpwg.org/</eref>; source code and issues list for this draft can be found at <eref target="https://github.com/httpwg/http-extensions/labels/proxy-status">https://github.com/httpwg/http-extensions/labels/proxy-status</eref>.</t>
      </note>
   </front>
   <middle>
      <section anchor="introduction">
         <name>Introduction</name>
         <t>HTTP intermediaries (see <xref section="3.7" sectionFormat="of" target="HTTP"><?aug-anchor intermediaries?><?aug-title Intermediaries?></xref>) -- 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.</t>
         <t>Typically, HTTP intermediaries forward requests towards the origin server (inbound) and then forward their responses back to clients (outbound). However, if an error occurs before a response is obtained from an inbound server, the response is often generated by the intermediary itself.</t>
         <t>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. Additionally, intermediaries sometimes want to convey additional information about their handling of a response, even if they did not generate it.</t>
         <t>To enable these uses, <xref target="header"/> defines a new HTTP response field to allow intermediaries to convey details of their handling of a response. <xref target="params"/> enumerates the information that can be added to the field by intermediaries, which can be extended as per <xref target="register-param"/>. <xref target="error-types"/> defines a set of error types for use when a proxy encounters an issue when obtaining a response for the request; these can likewise be extended as per <xref target="register-error"/>.</t>
         <section anchor="notational-conventions">
            <name>Notational Conventions</name>
            <t>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 <xref target="RFC2119"/>
               <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
            <t>This specification uses Structured Fields <xref target="STRUCTURED-FIELDS"/> to specify syntax and parsing, and ABNF <xref target="RFC5234"/> as a shorthand for that syntax. The terms sf-list, sf-item, sf-string, sf-token, sf-integer and key refer to the structured types defined therein.</t>
            <t>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.</t>
         </section>
      </section>
      <section anchor="header">
         <name>The Proxy-Status HTTP Field</name>
         <t>The Proxy-Status HTTP response field allows an intermediary to convey additional information about its handling of a response and its associated request. The syntax of this header field conforms to <xref target="STRUCTURED-FIELDS"/>.</t>
         <t>It is a List (<xref section="3.1" sectionFormat="comma" target="STRUCTURED-FIELDS"/>):</t>
         <figure>
            <sourcecode type="abnf">
Proxy-Status   = sf-list
</sourcecode>
         </figure>
         <t>Each member of the list represents an intermediary that has handled the response. The first member of the list represents the intermediary closest to the origin server, and the last member of the list represents the intermediary closest to the user agent.</t>
         <t>For example:</t>
         <figure>
            <sourcecode type="http-message">
Proxy-Status: revproxy1.example.net, ExampleCDN
</sourcecode>
         </figure>
         <t>indicates that this response was handled first by revproxy1.example.net (a reverse proxy adjacent to the origin server) and then ExampleCDN.</t>
         <t>Intermediaries determine when it is appropriate to add the Proxy-Status field to a response. Some might decide to append to it to all responses, whereas others might only do so when specifically configured to, or when the request contains a header field that activates a debugging mode.</t>
         <t>Each member of the list identifies the intermediary that inserted the value, and MUST have a type of either sf-string or sf-token. Depending on the deployment, this might be a service name (but not a software or hardware product name; e.g., "Example CDN"is appropriate, but "ExampleProxy" is not, because it doesn't identify the deployment), a hostname ("proxy-3.example.com"), an IP address, or a generated string.</t>
         <t>Parameters on each member (as per <xref section="3.1.2" sectionFormat="of" target="STRUCTURED-FIELDS"/>) convey additional information about that intermediary's handling of the response and its associated request; see <xref target="params"/>. While all of these parameters are OPTIONAL, intermediaries are encouraged to provide as much information as possible (but see <xref target="security"/> for security considerations in doing so).</t>
         <t>When adding a value to the Proxy-Status field, intermediaries SHOULD preserve the existing members of the field to allow debugging of the entire chain of intermediaries handling the request, unless explicitly configured to remove them (e.g., to prevent internal network details from leaking; see <xref target="security"/>).</t>
         <t>Origin servers MUST NOT generate the Proxy-Status field.</t>
         <t>Proxy-Status MAY be sent as a HTTP trailer field. For example, if an intermediary is streaming a response and the inbound connection suddenly terminates, Proxy-Status can only be appended to the trailer section of the outbound message, since the header section has already been sent. However, because it might be silently discarded along the path to the user agent (as is the case for all trailer fields; see <xref section="6.5" sectionFormat="of" target="HTTP"><?aug-anchor trailer.fields?><?aug-title Trailer Fields?></xref>), Proxy-Status SHOULD NOT be sent as a trailer field unless it is not possible to send it in the header section.</t>
         <t>To allow recipients to reconstruct the relative ordering of Proxy-Status members conveyed in trailer fields with those conveyed in header fields, an intermediary MUST NOT send Proxy-Status as a trailer field unless it has also generated a Proxy-Status header field with the same member (although potentially different parameters) in that message.</t>
         <t>For example, a proxy identified as 'ThisProxy' that receives a response bearing a header field:</t>
         <figure>
            <sourcecode type="http-message">
Proxy-Status: SomeOtherProxy
</sourcecode>
         </figure>
         <t>would add its own entry to the header field:</t>
         <figure>
            <sourcecode type="http-message">
Proxy-Status: SomeOtherProxy, ThisProxy
</sourcecode>
         </figure>
         <t>thus allowing it to append a trailer field:</t>
         <figure>
            <sourcecode type="http-message">
Proxy-Status: ThisProxy; error=read_timeout
</sourcecode>
         </figure>
         <t>... which would thereby allow a downstream recipient to understand that processing by 'SomeOtherProxy' occurred before 'ThisProxy'.</t>
         <t>A client MAY promote the Proxy-Status trailer field into a header field by following these steps:</t>
         <t>
            <list style="numbers">
               <t>For each member trailer_member of the Proxy-Status trailer field value: <list style="numbers">
                     <t>Let header_member be the first (left-most) value of the Proxy-Status header field value, comparing the sf-token or sf-string character-by-character and without consideration of parameters.</t>
                     <t>If no matching header_member is found, continue processing the next trailer_member.</t>
                     <t>Replace header_member with trailer_member in its entirety, including any parameters.</t>
                  </list>
               </t>
               <t>Remove the Proxy-Status trailer field, if empty.</t>
            </list>
         </t>
         <section anchor="params">
            <name>Proxy-Status Parameters</name>
            <t>This section lists parameters that can be used on the members of the Proxy-Status field. Unrecognised parameters MUST be ignored.</t>
            <section anchor="error">
               <name>error</name>
               <t>The <spanx style="verb">error</spanx> parameter's value is an sf-token that is a Proxy Error Type. When present, it indicates that the intermediary encountered an issue when obtaining this response.</t>
               <t>The presence of some Proxy Error Types indicates that the response was generated by the intermediary itself, rather than being forwarded from the origin server. This is the case when, for example, the origin server can't be contacted, so the proxy has to create its own response.</t>
               <t>Other Proxy Error Types can be added to (potentially partial) responses that were generated by the origin server or some other inbound server. For example, if the forward connection abruptly closes, an intermediary might add Proxy-Status with an appropriate error as a trailer field.</t>
               <t>Proxy Error Types that are registered with a 'Only generated by intermediaries' value of 'true' indicate that they can only occur on responses generated by the intermediary. If the value is 'false', the response might be generated by the intermediary or an inbound server.</t>
               <t>
                  <xref target="error-types"/> lists the Proxy Error Types defined in this document; new ones can be defined using the procedure outlined in <xref target="register-error"/>.</t>
               <t>For example:</t>
               <figure>
                  <sourcecode type="http-message">
HTTP/1.1 504 Gateway Timeout
Proxy-Status: ExampleCDN; error=connection_timeout
</sourcecode>
               </figure>
               <t>indicates that this 504 response was generated by ExampleCDN, due to a connection timeout when going forward.</t>
               <t>Or:</t>
               <figure>
                  <sourcecode type="http-message">
HTTP/1.1 429 Too Many Requests
Proxy-Status: r34.example.net; error=http_request_error, ExampleCDN
</sourcecode>
               </figure>
               <t>indicates that this 429 Too Many Requests response was generated by the reverse proxy, not the CDN or the origin.</t>
               <t>When sending the error parameter, the most specific Proxy Error Type SHOULD be sent, provided that it accurately represents the error condition. If an appropriate Proxy Error Type is not defined, there are a number of generic error types (e.g., proxy_internal_error, http_protocol_error) that can be used. If they are not suitable, consider registering a new Proxy Error Type (see <xref target="register-error"/>).</t>
               <t>Each Proxy Error Type has a Recommended HTTP Status Code. When generating a HTTP response containing <spanx style="verb">error</spanx>, 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, a status code has already been sent) when another status code might be used.</t>
               <t>Proxy Error Types can also define any number of extra parameters for use with that type. Their use, like all parameters, is optional. As a result, if an extra parameter is used with a Proxy Error Type for which it is not defined, it will be ignored.</t>
            </section>
            <section anchor="next-hop">
               <name>next-hop</name>
               <t>The <spanx style="verb">next-hop</spanx> parameter's value is an sf-string or sf-token that identifies the intermediary or origin server selected (and used, if contacted) to obtain this response. It might be a hostname, IP address, or alias.</t>
               <t>For example:</t>
               <figure>
                  <sourcecode type="http-message">
Proxy-Status: cdn.example.org; next-hop=backend.example.org:8001
</sourcecode>
               </figure>
               <t>indicates that cdn.example.org used backend.example.org:8001 as the next hop for this request.</t>
            </section>
            <section anchor="next-protocol">
               <name>next-protocol</name>
               <t>The <spanx style="verb">next-protocol</spanx> parameter's value indicates the ALPN protocol identifier <xref target="RFC7301"/> of the protocol used by the intermediary to connect to the next hop when obtaining this response.</t>
               <t>The value MUST be either an sf-token or sf-binary, representing a TLS Application-Layer Protocol Negotiation (ALPN) Protocol ID (see <eref target="https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids">https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids</eref>). If the protocol identifier is able to be expressed as an sf-token using ASCII encoding, that form MUST be used.</t>
               <t>For example:</t>
               <figure>
                  <sourcecode type="http-message">
Proxy-Status: "proxy.example.org"; next-protocol=h2
</sourcecode>
               </figure>
               <t>Note that the APLN identifier is being used here to identify the protocol in use; it may or may not have been actually used in the protocol negotiation.</t>
            </section>
            <section anchor="received-status">
               <name>received-status</name>
               <t>The <spanx style="verb">received-status</spanx> parameter's value indicates the HTTP status code that the intermediary received from the next hop server when obtaining this response.</t>
               <t>The value MUST be an sf-integer.</t>
               <t>For example:</t>
               <figure>
                  <sourcecode type="http-message">
Proxy-Status: ExampleCDN; received-status=200
</sourcecode>
               </figure>
            </section>
            <section anchor="details">
               <name>details</name>
               <t>The <spanx style="verb">details</spanx> parameter's value is an sf-string containing additional information not captured anywhere else. This can include implementation-specific or deployment-specific information.</t>
               <t>For example:</t>
               <figure>
                  <sourcecode type="http-message">
Proxy-Status: proxy.example.net; error="http_protocol_error";
              details="Malformed response header: space before colon"
</sourcecode>
               </figure>
            </section>
         </section>
         <section anchor="register-param">
            <name>Defining New Proxy-Status Parameters</name>
            <t>New Proxy-Status Parameters can be defined by registering them in the HTTP Proxy-Status Parameters registry.</t>
            <t>Registration requests are reviewed and approved by Expert Review, as per <xref section="4.5" sectionFormat="comma" target="RFC8126"/>. A specification document is appreciated, but not required.</t>
            <t>The Expert(s) should consider the following factors when evaluating requests:</t>
            <t>
               <list style="symbols">
                  <t>Community feedback</t>
                  <t>If the value is sufficiently well-defined</t>
                  <t>Generic parameters are preferred over vendor-specific, application-specific or deployment-specific values. If a generic value cannot be agreed upon in the community, the parameter's name should be correspondingly specific (e.g., with a prefix that identifies the vendor, application or deployment).</t>
                  <t>Parameter names should not conflict with registered extra parameters in the Proxy Error Type Registry.</t>
               </list>
            </t>
            <t>Registration requests should use the following template:</t>
            <t>
               <list style="symbols">
                  <t>Name: [a name for the Proxy-Status Parameter that matches key]</t>
                  <t>Description: [a description of the parameter semantics and value]</t>
                  <t>Reference: [to a specification defining this parameter; optional]</t>
               </list>
            </t>
            <t>See the registry at <eref target="https://iana.org/assignments/http-proxy-status">https://iana.org/assignments/http-proxy-status</eref> for details on where to send registration requests.</t>
         </section>
         <section anchor="error-types">
            <name>Proxy Error Types</name>
            <t>This section lists the Proxy Error Types defined by this document. See <xref target="register-error"/> for information about defining new Proxy Error Types.</t>
            <t>Note that implementations might not produce all Proxy Error Types. The set of types below is designed to map to existing states in implementations, and so may not be applicable to some.</t>
            <section anchor="dns-timeout">
               <name>DNS Timeout</name>
               <t>
                  <list style="symbols">
                     <t>Name: dns_timeout</t>
                     <t>Description: The intermediary encountered a timeout when trying to find an IP address for the next hop hostname.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 504</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="dns-error">
               <name>DNS Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: dns_error</t>
                     <t>Description: The intermediary encountered a DNS error when trying to find an IP address for the next hop hostname.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>rcode: A sf-string conveying the DNS RCODE that indicates the error type. See <xref section="3" sectionFormat="comma" target="RFC8499"/>.</t>
                           <t>info-code: A sf-integer conveying the Extended DNS Error Code info-code. See <xref target="RFC8914"/>.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="destination-not-found">
               <name>Destination Not Found</name>
               <t>
                  <list style="symbols">
                     <t>Name: destination_not_found</t>
                     <t>Description: The intermediary cannot determine the appropriate next hop to use for this request; for example, it may not be configured. Note that this error is specific to gateways, which typically require specific configuration to identify the "backend" server; forward proxies use in-band information to identify the origin server.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 500</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="destination-unavailable">
               <name>Destination Unavailable</name>
               <t>
                  <list style="symbols">
                     <t>Name: destination_unavailable</t>
                     <t>Description: The intermediary considers the next hop to be unavailable; e.g., recent attempts to communicate with it may have failed, or a health check may indicate that it is down.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 503</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="destination-ip-prohibited">
               <name>Destination IP Prohibited</name>
               <t>
                  <list style="symbols">
                     <t>Name: destination_ip_prohibited</t>
                     <t>Description: The intermediary is configured to prohibit connections to the next hop IP address.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="destination-ip-unroutable">
               <name>Destination IP Unroutable</name>
               <t>
                  <list style="symbols">
                     <t>Name: destination_ip_unroutable</t>
                     <t>Description: The intermediary cannot find a route to the next hop IP address.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-refused">
               <name>Connection Refused</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_refused</t>
                     <t>Description: The intermediary's connection to the next hop was refused.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-terminated">
               <name>Connection Terminated</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_terminated</t>
                     <t>Description: The intermediary's connection to the next hop was closed before complete response was received.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-timeout">
               <name>Connection Timeout</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_timeout</t>
                     <t>Description: The intermediary's attempt to open a connection to the next hop timed out.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 504</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-read-timeout">
               <name>Connection Read Timeout</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_read_timeout</t>
                     <t>Description: The intermediary was expecting data on a connection (e.g., part of a response), but did not receive any new data in a configured time limit.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 504</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-write-timeout">
               <name>Connection Write Timeout</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_write_timeout</t>
                     <t>Description: The intermediary was attempting to write data to a connection, but was not able to (e.g., because its buffers were full).</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 504</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="connection-limit-reached">
               <name>Connection Limit Reached</name>
               <t>
                  <list style="symbols">
                     <t>Name: connection_limit_reached</t>
                     <t>Description: The intermediary is configured to limit the number of connections it has to the next hop, and that limit has been passed.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 503</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="tls-protocol-error">
               <name>TLS Protocol Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: tls_protocol_error</t>
                     <t>Description: The intermediary encountered a TLS error when communicating with the next hop, either during handshake or afterwards.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                     <t>Notes: Not appropriate when a TLS alert is received; see tls_alert_received</t>
                  </list>
               </t>
            </section>
            <section anchor="tls-certificate-error">
               <name>TLS Certificate Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: tls_certificate_error</t>
                     <t>Description: The intermediary encountered an error when verifying the certificate presented by the next hop.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="tls-alert-received">
               <name>TLS Alert Received</name>
               <t>
                  <list style="symbols">
                     <t>Name: tls_alert_received</t>
                     <t>Description: The intermediary received a TLS alert from the next hop.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>alert-id: an sf-integer containing the applicable value from the TLS Alerts registry. See {!RFC8446}}.</t>
                           <t>alert-message: an sf-token or sf-string containing the applicable description string from the TLS Alerts registry. See <xref target="RFC8446"/>.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-request-error">
               <name>HTTP Request Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_request_error</t>
                     <t>Description: The intermediary is generating a client (4xx) response on the origin's behalf. Applicable status codes include (but are not limited to) 400, 403, 405, 406, 408, 411, 413, 414, 415, 416, 417, 429.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>status-code: an sf-integer containing the generated status code.</t>
                           <t>status-phrase: an sf-string containing the generated status phrase.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: The applicable 4xx status code</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                     <t>Notes: This type helps distinguish between responses generated by intermediaries from those generated by the origin.</t>
                  </list>
               </t>
            </section>
            <section anchor="http-request-denied">
               <name>HTTP Request Denied</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_request_denied</t>
                     <t>Description: The intermediary rejected the HTTP request based on its configuration and/or policy settings. The request wasn't forwarded to the next hop.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 403</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-incomplete-response">
               <name>HTTP Incomplete Response</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_incomplete</t>
                     <t>Description: The intermediary received an incomplete response to the request from the next hop.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-header-section-too-large">
               <name>HTTP Response Header Section Too Large</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_header_section_size</t>
                     <t>Description: The intermediary received a response to the request whose header section was considered too large.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>header-section-size: an sf-integer indicating how large the headers received were. Note that they might not be complete; i.e., the intermediary may have discarded or refused additional data.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-header-field-line-too-large">
               <name>HTTP Response Header Field Line Too Large</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_header_size</t>
                     <t>Description: The intermediary received a response to the request containing an individual header field line that was considered too large.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>header-name: an sf-string indicating the name of the header field that triggered the error.</t>
                           <t>header-size: an sf-integer indicating the size of the header field that triggered the error.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-body-too-large">
               <name>HTTP Response Body Too Large</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_body_size</t>
                     <t>Description: The intermediary received a response to the request whose body was considered too large.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>body-size: an sf-integer indicating how large the body received was. Note that it may not have been complete; i.e., the intermediary may have discarded or refused additional data.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-trailer-section-too-large">
               <name>HTTP Response Trailer Section Too Large</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_trailer_section_size</t>
                     <t>Description: The intermediary received a response to the request whose trailer section was considered too large.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>trailer-section-size: an sf-integer indicating how large the trailers received were. Note that they might not be complete; i.e., the intermediary may have discarded or refused additional data.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-trailer-field-line-too-large">
               <name>HTTP Response Trailer Field Line Too Large</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_trailer_size</t>
                     <t>Description: The intermediary received a response to the request containing an individual trailer field line that was considered too large.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>trailer-name: an sf-string indicating the name of the trailer field that triggered the error.</t>
                           <t>trailer-size: an sf-integer indicating the size of the trailer field that triggered the error.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-transfer-coding-error">
               <name>HTTP Response Transfer-Coding Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_transfer_coding</t>
                     <t>Description: The intermediary encountered an error decoding the transfer-coding of the response.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>coding: an sf-token containing the specific coding (from the HTTP Transfer Coding Registry) that caused the error.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-content-coding-error">
               <name>HTTP Response Content-Coding Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_content_coding</t>
                     <t>Description: The intermediary encountered an error decoding the content-coding of the response.</t>
                     <t>Extra Parameters: <list style="symbols">
                           <t>coding: an sf-token containing the specific coding (from the HTTP Content Coding Registry) that caused the error.</t>
                        </list>
                     </t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-response-timeout">
               <name>HTTP Response Timeout</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_response_timeout</t>
                     <t>Description: The intermediary reached a configured time limit waiting for the complete response.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 504</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-upgrade-failed">
               <name>HTTP Upgrade Failed</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_upgrade_failed</t>
                     <t>Description: The HTTP Upgrade between the intermediary and the next hop failed.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="http-protocol-error">
               <name>HTTP Protocol Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: http_protocol_error</t>
                     <t>Description: The intermediary encountered a HTTP protocol error when communicating with the next hop. This error should only be used when a more specific one is not defined.</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: false</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="proxy-internal-response">
               <name>Proxy Internal Response</name>
               <t>
                  <list style="symbols">
                     <t>Name: proxy_internal_response</t>
                     <t>Description: The intermediary generated the response locally, without attempting to connect to the next hop (e.g. in response to a request to a debug endpoint terminated at the intermediary).</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: The most appropriate status code for the response</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="proxy-internal-error">
               <name>Proxy Internal Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: proxy_internal_error</t>
                     <t>Description: The intermediary encountered an internal error unrelated to the origin.</t>
                     <t>Extra Parameters: None</t>
                     <t>Recommended HTTP status code: 500</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="proxy-configuration-error">
               <name>Proxy Configuration Error</name>
               <t>
                  <list style="symbols">
                     <t>Name: proxy_configuration_error</t>
                     <t>Description: The intermediary encountered an error regarding its configuration.</t>
                     <t>Extra Parameters: None</t>
                     <t>Recommended HTTP status code: 500</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
            <section anchor="proxy-loop-detected">
               <name>Proxy Loop Detected</name>
               <t>
                  <list style="symbols">
                     <t>Name: proxy_loop_detected</t>
                     <t>Description: The intermediary tried to forward the request to itself, or a loop has been detected using different means (e.g. <xref target="RFC8586"/>).</t>
                     <t>Extra Parameters: None.</t>
                     <t>Recommended HTTP status code: 502</t>
                     <t>Only generated by intermediaries: true</t>
                     <t>Reference: [this document]</t>
                  </list>
               </t>
            </section>
         </section>
         <section anchor="register-error">
            <name>Defining New Proxy Error Types</name>
            <t>New Proxy Error Types can be defined by registering them in the HTTP Proxy Error Types registry.</t>
            <t>Registration requests are reviewed and approved by Expert Review, as per <xref section="4.5" sectionFormat="comma" target="RFC8126"/>. A specification document is appreciated, but not required.</t>
            <t>The Expert(s) should consider the following factors when evaluating requests:</t>
            <t>
               <list style="symbols">
                  <t>Community feedback</t>
                  <t>If the value is sufficiently well-defined</t>
                  <t>Generic types are preferred over vendor-specific, application-specific or deployment-specific values. If a generic value cannot be agreed upon in the community, the types's name should be correspondingly specific (e.g., with a prefix that identifies the vendor, application or deployment).</t>
                  <t>Extra Parameters should not conflict with registered Proxy-Status parameters.</t>
               </list>
            </t>
            <t>Registration requests should use the following template:</t>
            <t>
               <list style="symbols">
                  <t>Name: [a name for the Proxy Error Type that matches sf-token]</t>
                  <t>Description: [a description of the conditions that generate the Proxy Error Type]</t>
                  <t>Extra Parameters: [zero or more optional parameters, along with their allowable type(s)]</t>
                  <t>Recommended HTTP status code: [the appropriate HTTP status code for this entry]</t>
                  <t>Only generated by intermediaries: ['true' or 'false']</t>
                  <t>Reference: [to a specification defining this error type; optional]</t>
                  <t>Notes: [optional]</t>
               </list>
            </t>
            <t>If the Proxy Error Type might occur in responses that are not generated by the intermediary -- for example, when an error is detected as the response is streamed from a forward connection, causing a Proxy-Status trailer field to be appended -- the 'Only generated by intermediaries' should be 'false'. If the Proxy Error Type only occurs in responses that are generated by the intermediary, it should be 'true'.</t>
            <t>See the registry at <eref target="https://iana.org/assignments/http-proxy-status">https://iana.org/assignments/http-proxy-status</eref> for details on where to send registration requests.</t>
         </section>
      </section>
      <section anchor="iana-considerations">
         <name>IANA Considerations</name>
         <t>Upon publication, please create the HTTP Proxy-Status Parameters registry and the HTTP Proxy Error Types registry at <eref target="https://iana.org/assignments/http-proxy-status">https://iana.org/assignments/http-proxy-status</eref> and populate them with the types defined in <xref target="params"/> and <xref target="error-types"/> respectively; see <xref target="register-param"/> and <xref target="register-error"/> for its associated procedures.</t>
         <t>Additionally, please register the following entry in the Hypertext Transfer Protocol (HTTP) Field Name Registry:</t>
         <t>
            <list style="symbols">
               <t>Field name: Proxy-Status</t>
               <t>Status: permanent</t>
               <t>Specification document(s): [this document]</t>
               <t>Comments:</t>
            </list>
         </t>
      </section>
      <section anchor="security">
         <name>Security Considerations</name>
         <t>One of the primary security concerns when using Proxy-Status is leaking information that might aid an attacker. For example, information about the intermediary's configuration and back-end topology can be exposed, allowing attackers to directly target back-end services that are not prepared for high traffic volume or malformed inputs. Some information might only be suitable to reveal to authorized parties.</t>
         <t>As a result, care needs to be taken when deciding to generate a Proxy-Status field and what information to include in it. Note that intermediaries are not required to generate a Proxy-Status field in any response, and can conditionally generate them based upon request attributes (e.g., authentication tokens, IP address).</t>
         <t>Likewise, generation of all parameters is optional, as is generation of the field itself. Also, the field's content is not verified; an intermediary can claim certain actions (e.g., sending a request over an encrypted channel) but fail to actually do that.</t>
      </section>
   </middle>
   <back>
      <references title="Normative References">
         <reference anchor="HTTP">
            <front>
               <title>HTTP Semantics</title>
               <author fullname="Roy T. Fielding">
                  <organization>Adobe</organization>
               </author>
               <author fullname="Mark Nottingham">
                  <organization>Fastly</organization>
               </author>
               <author fullname="Julian Reschke">
                  <organization>greenbytes GmbH</organization>
               </author>
               <date day="12" month="September" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-semantics-19"/>
            <x:source basename="draft-ietf-httpbis-semantics-19"
                      href="draft-ietf-httpbis-semantics-19.xml"/>
         </reference>
         <reference anchor="STRUCTURED-FIELDS">
            <front>
               <title>Structured Field Values for HTTP</title>
               <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
               <author fullname="P-H. Kamp" initials="P-H." surname="Kamp"/>
               <date month="February" year="2021"/>
            </front>
            <seriesInfo name="RFC" value="8941"/>
            <seriesInfo name="DOI" value="10.17487/RFC8941"/>
         </reference>
         <reference anchor="RFC2119">
            <front>
               <title>Key words for use in RFCs to Indicate Requirement Levels</title>
               <author fullname="S. Bradner" initials="S." surname="Bradner"/>
               <date month="March" year="1997"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="2119"/>
            <seriesInfo name="DOI" value="10.17487/RFC2119"/>
         </reference>
         <reference anchor="RFC8126">
            <front>
               <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
               <author fullname="M. Cotton" initials="M." surname="Cotton"/>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <author fullname="T. Narten" initials="T." surname="Narten"/>
               <date month="June" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="26"/>
            <seriesInfo name="RFC" value="8126"/>
            <seriesInfo name="DOI" value="10.17487/RFC8126"/>
         </reference>
         <reference anchor="RFC8499">
            <front>
               <title>DNS Terminology</title>
               <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
               <author fullname="A. Sullivan" initials="A." surname="Sullivan"/>
               <author fullname="K. Fujiwara" initials="K." surname="Fujiwara"/>
               <date month="January" year="2019"/>
            </front>
            <seriesInfo name="BCP" value="219"/>
            <seriesInfo name="RFC" value="8499"/>
            <seriesInfo name="DOI" value="10.17487/RFC8499"/>
         </reference>
         <reference anchor="RFC8174">
            <front>
               <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <date month="May" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
         </reference>
         <reference anchor="RFC7301">
            <front>
               <title>Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension</title>
               <author fullname="S. Friedl" initials="S." surname="Friedl"/>
               <author fullname="A. Popov" initials="A." surname="Popov"/>
               <author fullname="A. Langley" initials="A." surname="Langley"/>
               <author fullname="E. Stephan" initials="E." surname="Stephan"/>
               <date month="July" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7301"/>
            <seriesInfo name="DOI" value="10.17487/RFC7301"/>
         </reference>
         <reference anchor="RFC8914">
            <front>
               <title>Extended DNS Errors</title>
               <author fullname="W. Kumari" initials="W." surname="Kumari"/>
               <author fullname="E. Hunt" initials="E." surname="Hunt"/>
               <author fullname="R. Arends" initials="R." surname="Arends"/>
               <author fullname="W. Hardaker" initials="W." surname="Hardaker"/>
               <author fullname="D. Lawrence" initials="D." surname="Lawrence"/>
               <date month="October" year="2020"/>
            </front>
            <seriesInfo name="RFC" value="8914"/>
            <seriesInfo name="DOI" value="10.17487/RFC8914"/>
         </reference>
         <reference anchor="RFC8446">
            <front>
               <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
               <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
               <date month="August" year="2018"/>
            </front>
            <seriesInfo name="RFC" value="8446"/>
            <seriesInfo name="DOI" value="10.17487/RFC8446"/>
         </reference>
      </references>
      <references title="Informative References">
         <reference anchor="RFC5234">
            <front>
               <title>Augmented BNF for Syntax Specifications: ABNF</title>
               <author fullname="D. Crocker"
                       initials="D."
                       role="editor"
                       surname="Crocker"/>
               <author fullname="P. Overell" initials="P." surname="Overell"/>
               <date month="January" year="2008"/>
            </front>
            <seriesInfo name="STD" value="68"/>
            <seriesInfo name="RFC" value="5234"/>
            <seriesInfo name="DOI" value="10.17487/RFC5234"/>
         </reference>
         <reference anchor="RFC8586">
            <front>
               <title>Loop Detection in Content Delivery Networks (CDNs)</title>
               <author fullname="S. Ludin" initials="S." surname="Ludin"/>
               <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
               <author fullname="N. Sullivan" initials="N." surname="Sullivan"/>
               <date month="April" year="2019"/>
            </front>
            <seriesInfo name="RFC" value="8586"/>
            <seriesInfo name="DOI" value="10.17487/RFC8586"/>
         </reference>
      </references>
   </back>
</rfc>
