tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: redirect request from 8080 to port 80
Date Wed, 15 May 2013 18:32:11 GMT
On 15/05/2013 17:15, André Warnier wrote:
> Ognjen Blagojevic wrote:
>> André,
>> On 15.5.2013 15:38, André Warnier wrote:
>>> As far as I understand here, we are not talking about a proxy situation,
>>> we are talking about Iptables, which does not proxy, it just modifies
>>> packets.
>>> So the URL that Tomcat gets from the 1st request line does not contain a
>>> hostname[:port}.
>> According to RFC2616 (Section 5.1.2), client may send absolute URI or
>> absolute path. Majority of clients will send absolute path when
>> talking to the server.
> Absolute *path*, yes. They MUST do that if they are talking to "this"
> server.
> But HTTP 1.1 clients will only send an absolute URI (including
> hotsname[:port] when talking to a proxy.
> In this case we are not in a proxy situation, so the request line will
> not contain http://hotsname[:port].

While RFC2616 requires that a proxy uses an absolute URL nothing
prevents a standard client from using them if it wishes. Which is why I
stated in my reply "Depending on the client behaviour..."

> Yes, that it will be read seems normal.
> But that it would be logged as the port on which the request was
> received, seems a bit less intuitive.
> But if that is what happens..

Repeating myself again, what is logged in the access logs depends on the
pattern the access log is configured with.

> I find it less intuitive because of the Javadoc of
> HttpServletRequest.getLocalPort :
>  getLocalPort
> int getLocalPort()
>     Returns the Internet Protocol (IP) port number of the interface on
> which the request was received.
>     Returns:
>         an integer specifying the port number
>     Since:
>         Servlet 2.4
> So that is the interface (the Connector), not the port number mentioned
> in the Host header.

Yes, but with the caveat that proxyPort will change the result of that call.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message