The HTTP X-Forwarded-Host header is a request-type header de-facto standard header. This header is used to identify the original request made by the client. Because the hostnames and the ports differ in the reverse proxies that time this header took the leade and identify the original request. This header can also be used for debugging, creating location-based content. So this header kept the privacy of the client. The root version of this header is HTTP Forwarded.
Directives: This header accepts a single directive as mentioned above and described below:
- <host>: This directive holds the domain name of the forwrded server.
Below examples illustrate the HTTP X-Forwarded-Host header:
- In this example visited site was forwarded from the mentioned host website.
- In this example forwarded host is geeksforgeeks cdn page.
To check the X-Forwarded-Host in action go to Inspect Element -> Network check the request header for X-Forwarded-Host like below.
Supported Browsers: The browsers are compatible with the HTTP X-Forwarded-Host header is unknown till now.
- HTML 5 | <header> Tag
- HTML | DOM Header Object
- How to read any request header in PHP
- jQuery | :header Selector
- HTML Course | Building Header of the Website
- PHP | header() Function
- How to group header content of a table using HTML5 ?
- How to make a Bootstrap 4 accordion collapse when clicking the whole header div ?
- Semantic-UI | Header
- How to align header with wrapper in Bootstrap ?
- Header files in C/C++ and its uses
- How to create Hidden Header using Google AMP amp-accordion?
- How to create Dynamic Header using Google AMP amp-accordion?
- How to create a header cell in a table using HTML5 ?
- How to define header for a document or section using HTML ?
- HTTP Cookies in Node.js
- HTTP GET and POST Methods in PHP
- PHP | $_FILES Array (HTTP File Upload variables)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.