Details
Description
When requests are forwarded to jetty, it users the X-Forwarded-Server instead of X-Forwarded-Host to determine the server name for the request. The X-Forwarded-Server contains the ServerName of the Apache's VirtualHost that is forwarding the requests. If the remote client requests a resource by IP address, jetty receives a request that looks approximately like
GET /directory HTTP/1.1
X-Forwarded-For: client ip
X-Forwarded-Server: proxy.example.com
X-Forwarded-Host: server ip
Host: server ip
and it responds with something like
HTTP/1.1 302
Location: http://proxy.example.com/directory/
When it should respond with
HTTP/1.1 302
Location: http://server ip/directory/
In short, jetty should prefer the host contained in X-Forwarded-Host over X-Forwarded-Server. I am appending a (small) patch to amend the issue.
thanks