HTTP Working GroupM. Nottingham
Internet-DraftFastly
Intended status: Standards TrackP. Sikora
Expires: May 20, 2020Google
November 17, 2019

The Proxy-Status HTTP Header Field

Abstract

This document defines the Proxy-Status HTTP header field to convey the details of errors generated by HTTP intermediaries.

Note to Readers

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.

Status of this Memo

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 http://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 May 20, 2020.

Copyright Notice

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 (http://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.



1. Introduction

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.

1.1. Notational Conventions

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.



3. 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.

3.1. DNS Timeout

  • Name: dns_timeout
  • Description: The intermediary encountered a timeout when trying to find an IP address for the destination hostname.
  • Extra Parameters: None.
  • Recommended HTTP status code: 504

3.2. DNS Error

  • Name: dns_error
  • Description: The intermediary encountered a DNS error when trying to find an IP address for the destination hostname.
  • Extra Parameters:
    • rcode: A sh-string conveying the DNS RCODE that indicates the error type. See [RFC8499], Section 3.
  • Recommended HTTP status code: 502

3.3. Destination Not Found

  • Name: destination_not_found
  • 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.
  • Extra Parameters: None.
  • Recommended HTTP status code: 500

3.4. Destination Unavailable

  • Name: destination_unavailable
  • 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.
  • Extra Parameters: None.
  • Recommended HTTP status code: 503

3.5. Destination IP Prohibited

  • Name: destination_ip_prohibited
  • Description: The intermediary is configured to prohibit connections to the destination IP address.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.6. Destination IP Unroutable

  • Name: destination_ip_unroutable
  • Description: The intermediary cannot find a route to the next hop IP address.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.7. Connection Refused

  • Name: connection_refused
  • Description: The intermediary’s connection to the next hop was refused.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.8. Connection Terminated

  • Name: connection_terminated
  • Description: The intermediary’s connection to the next hop was closed before any part of the response was received. If some part was received, see http_response_incomplete.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.9. Connection Timeout

  • Name: connection_timeout
  • Description: The intermediary’s attempt to open a connection to the next hop timed out.
  • Extra Parameters: None.
  • Recommended HTTP status code: 504

3.10. Connection Read Timeout

  • Name: connection_read_timeout
  • 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.
  • Extra Parameters: None.
  • Recommended HTTP status code: 504

3.11. Connection Write Timeout

  • Name: connection_write_timeout
  • Description: The intermediary was attempting to write data to a connection, but was not able to (e.g., because its buffers were full).
  • Extra Parameters: None.
  • Recommended HTTP status code: 504

3.12. Connection Limit Reached

  • Name: connnection_limit_reached
  • Description: The intermediary is configured to limit the number of connections it has to the next hop, and that limit has been passed.
  • Extra Parameters: None.
  • Recommended HTTP status code: 503

3.13. HTTP Response Status

  • Name: http_response_status
  • Description: The intermediary has received a response from the next hop and forwarded it to the client.
  • Extra Parameters: None.
  • Recommended HTTP status code:

3.14. HTTP Incomplete Response

  • Name: http_response_incomplete
  • Description: The intermediary received an incomplete response to the request from the next hop.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.15. HTTP Protocol Error

  • Name: http_protocol_error
  • 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.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.16. HTTP Response Header Block Too Large

  • Name: http_response_header_block_size
  • Description: The intermediary received a response to the request whose header block was considered too large.
  • Extra Parameters:
    • header_block_size: a sh-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.
  • Recommended HTTP status code: 502

3.17. HTTP Response Header Too Large

  • Name: http_response_header_size
  • Description: The intermediary received a response to the request containing an individual header line that was considered too large.
  • Extra Parameters:
    • header_name: a sh-string indicating the name of the header that triggered the error.
  • Recommended HTTP status code: 502

3.18. HTTP Response Body Too Large

  • Name: http_response_body_size
  • Description: The intermediary received a response to the request whose body was considered too large.
  • Extra Parameters:
    • body_size: a sh-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.
  • Recommended HTTP status code: 502

3.19. HTTP Response Transfer-Coding Error

  • Name: http_response_transfer_coding
  • Description: The intermediary encountered an error decoding the transfer-coding of the response.
  • Extra Parameters:
    • coding: a sh-token containing the specific coding that caused the error.
  • Recommended HTTP status code: 502

3.20. HTTP Response Content-Coding Error

  • Name: http_response_content_coding
  • Description: The intermediary encountered an error decoding the content-coding of the response.
  • Extra Parameters:
    • coding: a sh-token containing the specific coding that caused the error.
  • Recommended HTTP status code: 502

3.21. HTTP Response Timeout

  • Name: http_response_timeout
  • Description: The intermediary reached a configured time limit waiting for the complete response.
  • Extra Parameters: None.
  • Recommended HTTP status code: 504

3.22. TLS Handshake Error

  • Name: tls_handshake_error
  • Description: The intermediary encountered an error during TLS handshake with the next hop.
  • Extra Parameters:
    • alert_message: a sh-token containing the applicable description string from the TLS Alerts registry.
  • Recommended HTTP status code: 502

3.23. TLS Untrusted Peer Certificate

  • Name: tls_untrusted_peer_certificate
  • Description: The intermediary received untrusted peer certificate during TLS handshake with the next hop.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.24. TLS Expired Peer Certificate

  • Name: tls_expired_peer_certificate
  • Description: The intermediary received expired peer certificate during TLS handshake with the next hop.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.25. TLS Unexpected Peer Certificate

  • Name: tls_unexpected_peer_certificate
  • Description: The intermediary received unexpected peer certificate (e.g., SPKI doesn’t match) during TLS handshake with the next hop.
  • Extra Parameters:
    • identity: a sh-string containing a comma-separated list of Subject Alternative Names from the certificate received from the next hop.
    • sha256: a sh-string containing the hex-encoded SHA-256 of the certificate received from the next hop.
    • spki: a sh-string containing the base64-encoded SHA-256 of the Subject Public Key Info (SPKI) from the certificate received from the next hop.
  • Recommended HTTP status code: 502

3.26. TLS Missing Proxy Certificate

  • Name: tls_missing_proxy_certificate
  • Description: The next hop requested client certificate from the intermediary during TLS handshake, but it wasn’t configured with one.
  • Extra Parameters: None.
  • Recommended HTTP status code: 500

3.27. TLS Rejected Proxy Certificate

  • Name: tls_rejected_proxy_certificate
  • Description: The next hop rejected client certificate provided by the intermediary during TLS handshake.
  • Extra Parameters: None.
  • Recommended HTTP status code: 500

3.28. TLS Error

  • Name: tls_error
  • Description: The intermediary encountered a TLS error when communicating with the next hop.
  • Extra Parameters:
    • alert_message: a sh-token containing the applicable description string from the TLS Alerts registry.
  • Recommended HTTP status code: 502

3.29. HTTP Request Bad Request

  • Name: http_request_bad_request
  • Description: The intermediary is generating a 400 (Bad Request) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 400

3.30. HTTP Request Unauthorized

  • Name: http_request_unauthorized
  • Description: The intermediary is generating a 401 (Unauthorized) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 401

3.31. HTTP Request Forbidden

  • Name: http_request_forbidden
  • Description: The intermediary is generating a 403 (Forbidden) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 403

3.32. HTTP Request Not Found

  • Name: http_request_not_found
  • Description: The intermediary is generating a 404 (Not Found) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 404

3.33. HTTP Request Method Not Allowed

  • Name: http_request_method_not_allowed
  • Description: The intermediary is generating a 405 (Method Not Allowed) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 405

3.34. HTTP Request Not Acceptable

  • Name: http_request_not_acceptable
  • Description: The intermediary is generating a 406 (Not Acceptable) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 406

3.35. HTTP Request Proxy Authentication Required

  • Name: http_request_proxy_authentication_required
  • Description: The intermediary is generating a 407 (Proxy Authentication Required) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 407

3.36. HTTP Request Timeout

  • Name: http_request_timeout
  • Description: The intermediary is generating a 408 (Request Timeout) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 408

3.37. HTTP Request Conflict

  • Name: http_request_conflict
  • Description: The intermediary is generating a 408 (Conflict) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 409

3.38. HTTP Request Timeout

  • Name: http_request_gone
  • Description: The intermediary is generating a 410 (Gone) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 410

3.39. HTTP Request Length Required

  • Name: http_request_length_required
  • Description: The intermediary is generating a 411 (Length Required) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 411

3.40. HTTP Request Precondition Failed

  • Name: http_request_precondition_failed
  • Description: The intermediary is generating a 412 (Precondition Failed) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 412

3.41. HTTP Request Payload Too Large

  • Name: http_request_payload_too_large
  • Description: The intermediary is generating a 413 (Payload Too Large) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 413

3.42. HTTP Request URI Too Long

  • Name: http_request_uri_too_long
  • Description: The intermediary is generating a 414 (URI Too Long) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 414

3.43. HTTP Request Unsupported Media Type

  • Name: http_request_unsupported_media_type
  • Description: The intermediary is generating a 415 (Unsupported Media Type) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 415

3.44. HTTP Request Range Not Satisfiable

  • Name: http_request_range_not_satisfiable
  • Description: The intermediary is generating a 416 (Range Not Satisfiable) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 416

3.45. HTTP Request Expectation Failed

  • Name: http_request_expectation_failed
  • Description: The intermediary is generating a 417 (Expectation Failed) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 417

3.46. HTTP Request Misdirected Request

  • Name: http_request_misdirected_request
  • Description: The intermediary is generating a 421 (Misdirected Request) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 421

3.47. HTTP Request Unprocessable Entity

  • Name: http_request_unprocessable_entity
  • Description: The intermediary is generating a 422 (Unprocessable Entity) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 422

3.48. HTTP Request Locked

  • Name: http_request_locked
  • Description: The intermediary is generating a 423 (Locked) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 423

3.49. HTTP Request Failed Dependency

  • Name: http_request_failed_dependency
  • Description: The intermediary is generating a 424 (Failed Dependency) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 424

3.50. HTTP Request Too Early

  • Name: http_request_too_early
  • Description: The intermediary is generating a 425 (Too Early) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 425

3.51. HTTP Request Upgrade Required

  • Name: http_request_upgrade_required
  • Description: The intermediary is generating a 426 (Upgrade Required) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 426

3.52. HTTP Request Precondition Required

  • Name: http_request_precondition_required
  • Description: The intermediary is generating a 428 (Precondition Required) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 428

3.53. HTTP Request Too Many Requests

  • Name: http_request_too_many_requests
  • Description: The intermediary is generating a 429 (Too Many Requests) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 429

3.54. HTTP Request Header Fields Too Large

  • Name: http_request_header_fields_too_large
  • Description: The intermediary is generating a 431 (Request Header Fields Too Large) response on the origin’s behalf. This proxy status type helps distinguish between responses generated by intermediaries from those generated by the origin.
  • Extra Parameters: None.
  • Recommended HTTP status code: 431

3.56. HTTP Request Denied

  • Name: http_request_denied
  • Description: The intermediary rejected HTTP request based on its configuration and/or policy settings. The request wasn’t forwarded to the next hop.
  • Extra Parameters: None.
  • Recommended HTTP status code: 400

3.57. HTTP Upgrade Failed

  • Name: http_upgrade_failed
  • Description: The HTTP Upgrade between the intermediary and the next hop failed.
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

3.58. Proxy Internal Response

  • Name: proxy_internal_response
  • 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).
  • Extra Parameters: None.
  • Recommended HTTP status code:

3.59. Proxy Internal Error

  • Name: proxy_internal_error
  • Description: The intermediary encountered an internal error unrelated to the origin.
  • Extra Parameters:
    • error: a sh-string containing details about the error condition.
  • Recommended HTTP status code: 500

3.60. Proxy Loop Detected

  • Name: proxy_loop_detected
  • Description: The intermediary tried to forward the request to itself, or a loop has been detected using different means (e.g. [RFC8586]).
  • Extra Parameters: None.
  • Recommended HTTP status code: 502

4. 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.


5. IANA Considerations

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.


6. Security Considerations

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.


7. References

7.1. Normative References

[I-D.ietf-httpbis-header-structure]
Nottingham, M. and P. Kamp, “Structured Headers for HTTP”, Internet-Draft draft-ietf-httpbis-header-structure-14 (work in progress), October 2019.
[RFC2119]
Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.
[RFC7301]
Friedl, S., Popov, A., Langley, A., and E. Stephan, “Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension”, RFC 7301, DOI 10.17487/RFC7301, July 2014, <https://www.rfc-editor.org/info/rfc7301>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten, “Guidelines for Writing an IANA Considerations Section in RFCs”, BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/info/rfc8126>.
[RFC8174]
Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8499]
Hoffman, P., Sullivan, A., and K. Fujiwara, “DNS Terminology”, BCP 219, RFC 8499, DOI 10.17487/RFC8499, January 2019, <https://www.rfc-editor.org/info/rfc8499>.

7.2. Informative References

[RFC8586]
Ludin, S., Nottingham, M., and N. Sullivan, “Loop Detection in Content Delivery Networks (CDNs)”, RFC 8586, DOI 10.17487/RFC8586, April 2019, <https://www.rfc-editor.org/info/rfc8586>.

Authors' Addresses

Mark Nottingham
Fastly
EMail: mnot@mnot.net
URI: https://www.mnot.net/
Piotr Sikora
Google
EMail: piotrsikora@google.com