Real life usage of the X-Forwarded-Host header?

前端 未结 7 480
予麋鹿
予麋鹿 2021-01-30 05:09

I\'ve found some interesting reading on the X-Forwarded-* headers, including the Reverse Proxy Request Headers section in the Apache documentation, as well as the

相关标签:
7条回答
  • 2021-01-30 05:54

    I can tell you a real life issue, I had an issue using an IBM portal.

    In my case the problem was that the IBM portal has a rest service which retrieves an url for a resource, something like: {"url":"http://internal.host.name/path"}

    What happened? Simple, when you enter from intranet everything works fine because internalHostName exists but... when the user enter from internet then the proxy is not able to resolve the host name and the portal crashes.

    The fix for the IBM portal was to read the X-FORWARDED-HOST header and then change the response to something like: {"url":"http://internet.host.name/path"}

    See that I put internet and not internal in the second response.

    0 讨论(0)
提交回复
热议问题