The HTTP headers are used to communicate between client and server. HTTP headers let the client and server pass additional information with an HTTP request or response. X-Forwarded-Proto (XPF) header is used to identifying the protocol that the client used to connect with a proxy or load balancer. It can be HTTP or HTTPS. Your server access log usually contains information about the protocol used between server and load balancer, but it does not contain any information about the protocol used between the client and load balancer. To get information about which protocol used between client and load balancer, we can use the X-Forwarded-Proto request header. Using this header, the client can make an HTTP request to an HTTPS-only resource.
- <protocol>: This contains an X-Forwarded-Proto request header for a request that originated from the client(http or https).
Example 1: The following example contains an X-Forwarded-Proto request header for a request that originated from the client as an HTTP request:
Example 2: The following example contains an X-Forwarded-Proto request header for a request that originated from the client as an HTTPS request:
Example 3: This eaxmple is for other non-standard form.
Note: This HTTP headers X-Forwarded-Proto is useful when you want to keep a record of the protocol client and load balancer.
Supported Browsers: Compatibility for the HTTP headers X-Forwarded-Proto for the browsers still unknown.
- HTTP headers | Age
- HTTP headers | Via
- HTTP headers | Last-Modified
- HTTP headers | Host
- HTTP headers | X-XSS-Protection
- HTTP headers | Set-Cookie2
- HTTP headers | If-None-Match
- HTTP headers | Accept
- HTTP headers | Origin
- HTTP headers | X-Forwarded-For
- HTTP headers | Trailer
- HTTP headers | Date
- HTTP headers | Retry-After
- HTTP headers | Digest
- HTTP headers | Range
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.