title: Real life usage of the X-Forwarded-Host header?
body: <p>I've found some interesting reading on the <code>X-Forwarded-*</code> headers, including the  <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers">Reverse Proxy Request Headers</a> section in the Apache documentation, as well as the <a href="http://en.wikipedia.org/wiki/X-Forwarded-For">Wikipedia article on X-Forwarded-For</a>.</p>
  
  <p>I understand that:</p>
  
  <ul>
  <li><code>X-Forwarded-For</code> gives the address of the client which connected to the proxy</li>
  <li><code>X-Forwarded-Port</code> gives the port the client connected to on the proxy (e.g. <code>80</code> or <code>443</code>)</li>
  <li><code>X-Forwarded-Proto</code> gives the protocol the client used to connect to the proxy (<code>http</code> or <code>https</code>)</li>
  <li><code>X-Forwarded-Host</code> gives the content of the <code>Host</code> header the client sent to the proxy.</li>
  </ul>
  
  <p>These all make sense.</p>
  
  <p>However, I still can't figure out a real life use case of <code>X-Forwarded-Host</code>. I understand the need to repeat the connection on a different port or using a different scheme, but <strong>why would a proxy server ever change the <code>Host</code> header when repeating the request to the target server?</strong></p>