X-Forwarded-Proto HTTP Header: Syntax, Directive, Examples

The X-Forwarded-Proto HTTP header is a de-facto standard for identifying a client’s connection protocol (HTTP or HTTPS). From your server access logs, it is not clear which protocol is being utilized between the server and the load balancer. The X-Forwarded-Proto HTTP Header request header can be used to determine the client-load balancer protocol. The X-Forwarded-Proto HTTP Header value is the protocol. The HTTP protocol is used to retrieve HTML text and other resources. A client-server protocol is the backbone of all data exchange on the Internet, and requests are made by the recipient, typically a web browser. For client requests (HTTP or HTTPS), the value of the X-Forwarded-Proto HTTP Header request header. The following is an example of an X-Forwarded-Proto HTTP Header for the request header for a client-made HTTP request.

X-Forwarded-Proto: https

X-Forwarded-Proto HTTP Header request header can be seen above. In this article, the X-Forwarded-Proto HTTP Header Syntax, Directives, and Uses with examples will be processed.

What is X-Forwarded-Proto HTTP Header?

The X-Forwarded-Proto HTTP Header is the de-facto industry standard for identifying the protocol (HTTP or HTTPS) being used by a client when connecting to your proxy or load balancer, but they do not contain information about the protocol that was used between the client and the load balancer. The X-Forwarded-Proto HTTP Header request header can be used to determine the protocol that is being used between the client and the load balancer if one is being utilized. 

What is the Syntax of X-Forwarded-Proto HTTP Header?

The syntax of the X-Forwarded-Proto HTTP Header has one part. In order to use X-Forwarded-Proto HTTP Header, follow the example syntax below.

X-Forwarded-Proto: <protocol>

What is the Directive of X-Forwarded-Proto HTTP Header?

The directive of X-Forwarded-Proto HTTP Header is only one. The X-Forwarded-Proto HTTP Header directive is the protocol which is the value that contains an X-Forwarded-Proto HTTP Header request header for a request that originated from the client (HTTP or HTTPS).

Below are examples of usage of the directives X-Forwarded-Proto HTTP Header.

  • The first example shows how to do something. If a request comes from the client as an HTTP request, the following example has an X-Forwarded-Proto HTTP Header request header in it.
// X-Forwarded-Proto: originatingprotocol
X-Forwarded-Proto: http
  • The following example has an X-Forwarded-Proto HTTP Header request header for an HTTPS request sent by the client.
// X-Forwarded-Proto: originatingprotocol
X-Forwarded-Proto: https
  • This is an example of another non-standard form.
# Microsoft
Front-End-Https: on
X-Forwarded-Protocol: http
X-Forwarded-Ssl: on
X-Url-Scheme: http

How to use X-Forwarded-Proto HTTP Header?

The X-Forwarded-Proto HTTP Header request header can be used to determine the protocol that is being utilized between the client and the load balancer. The request header to determine the protocol is the “Forwarded Header”. This header provides information that may be added by reverse proxy servers (such as load balancers, content delivery networks, and so on) that would otherwise be altered or lost when proxy servers are engaged in the request’s journey. This header is used for debugging, statistics, and creating material that is specific to a certain location. It is intended to expose information that is sensitive to privacy, such as the IP address of the client. Therefore, when installing this header, it is important to keep the user’s confidentiality in mind.

Examples of X-Forwarded-Proto HTTP Header Use

One example of the X-Forwarded-Proto HTTP Header port number used by the client to connect to the load balancer. An example of the X-Forwarded-Proto HTTP Header use can be found below.

X-Forwarded-Proto: https

What is the Specification Document for X-Forwarded-Proto HTTP Header?

There is only one specification document for the X-Forwarded-Proto HTTP Header which is the RFC 7239. The RFC 7239 article mentioned the X-Forwarded-Proto HTTP Header as a common way to disclose information by using the non-standard header fields for the Forwarded HTTP Extension. Additionally, this article discusses the X-Forwarded-Proto HTTP Header’s definition and usage.

What are the types of X-Forwarded-Proto HTTP Header?

The X-Forwarded-Proto HTTP Header HTTP Type is listed below.

  1. Request Headers. The purpose of this header is to provide data for the required subject in an HTTP request that will generate the server.
  2. Representation Headers. This header can be used when the information generated about the subject by utilizing other headers is insufficient or inaccurate.

What are the similar HTTP Headers to the X-Forwarded-Proto HTTP Header?

The similar HTTP Headers to the X-Forwarded-Proto HTTP Header are listed below.

  • Forwarded HTTP Header: The similarity of Forwarded HTTP to the X-Forwarded-Proto HTTP Header is they both contain information that may add reverse proxy servers such as load balancers, CDN, and so on, that would otherwise be altered or lost when proxy servers are involved in the path of the request. 
  • X-Forwarded-Host HTTP Header: The X-Forwarded-Host HTTP and X-Forwarded-Proto HTTP Header are similar in that they are requested type headers and are an alternative and de-facto standard version of the forward header. The X-Forwarded-Proto HTTP Header is a header for identifying the protocol, while the X-Forwarded-Host is a header that identifies the original request made by the client. 
  • X-Forwarded-For HTTP Header: The X-Forwarded-For HTTP and X-Forwarded-Proto HTTP Header are similar in that they are requested type headers and are an alternative and de-facto standard version of the forward header, which is used to identify the original IP address when a client connects to a web server via an HTTP proxy or load balancer.

Which Browsers Support X-Forwarded-Proto HTTP Header? 

The compatibility of browsers for the X-Forwarded-Proto HTTP Header is unknown.

Holistic SEO
Follow SEO

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.