X-Forwarded-Host vs. x-Forwarded-Server

What is the difference between the following titles?

  • X-Forwarded-Host
  • X-Forwarded-server

In a setup with Apache being the proxy and Tomcat being the origin server, I see both of these in the HTTP requests that reach Tomcat. The values ​​were (this is from my own code logging names and header pairs with actual caps that I ran into)

x-forwarded-host some-server
x-forwarded-server some-server.dept.some-uni.edu

      

Are these values ​​typical? Which of the two should I use to reliably recover the URL given by the browser? In my case, the browser sent a GET with a value some-server.dept.some-uni.edu

in the request url, which makes me think it is x-forwarded-server

more appropriate to recover the url. I believe this is somewhat at odds with the MDN documentation , which only mentions X-Forwarded-Host

and states that this is a "standard de facto header to identify the original host requested by the client" (and no documentation on x-forwarded-server

)

This Apache OTOH page describes both headers as follows:

  • X-Forwarded-Host The original host requested by the client in the Host HTTP header.
  • X-Forwarded-Server Hostname of the proxy server.

(I appreciate that in order to recover the url I also need X-Forwarded-Proto

and X-Forwarded-Port

)

+3
http-headers apache


source to share


No one has answered this question yet

Check out similar questions:

99
Why is the Cache-Control attribute sent in the request header (from client to server)?
36
Real life use of X-Forwarded-Host header?
nine
X-FORWARDED-PROTO handling in java apache-tomcat
0
How to get HTTP_HOST reverse proxies from an internal application server
0
How do I configure my apache 2 reverse proxy to forward another domain and pretend it is a domain name?
0
Google proxy and missing X-Forwarded-For headers
0
Proxy redirects my request to another user
0
Config apache don't use x-forwarded-host header for hostname
0
Set Host HttpRequest header in Apache Web Server 2.4
0
Tomcat behind Apache behind firewall: AJP ignores X-Forwarded-Proto



All Articles
Loading...
X
Show
Funny
Dev
Pics