Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] NAT with HTTP 1.0 returns internal IP address

On 04/08/2013 06:50 PM, Simone Bordet wrote:
Hi,

On Mon, Apr 8, 2013 at 6:43 PM, martijn.list <martijn.list@xxxxxxxxx> wrote:
But isn't this only for SSL?

Not sure what you mean here, but the "redirection" happens at the HTTP
level, not at the connection level.
As such, it is part of the HTTP configuration.

According to the Javadoc, securePort is "The port to which Integral or Confidential security constraints are redirected". However in my view the problem is related to what ServletRequest#getServerName() returns *if* the Location header is not set.

It looks like the implementation of ServletRequest#getServerName() fallsback to using InetAddress#getLocalHost() if the Location header of the request is not set. What I would like is to override what's being returned by ServletRequest#getServerName() if the Location header is not set (i.e., allow me to override the default return of the local IP address). I think this is needed since a lot of Java web frameworks use ServletRequest#getServerName() for generating a redirect URL.

For example Tomcat allows you to set a proxyName parameter on the connector:

"proxyName: If this Connector is being used in a proxy configuration, configure this attribute to specify the server name to be returned for calls to request.getServerName(). See Proxy Support for more information."

http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

Kind regards,

Martijn Brinkers

We're going to fix this for Jetty 9, unlikely that we fix it for
previous Jetty versions, unless priorities change.

:( ok. I'll checkout Jetty 9

Kind regards,

Martijn Brinkers


Back to the top