tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: redirect request from 8080 to port 80
Date Wed, 15 May 2013 13:38:06 GMT
Mark Thomas wrote:
> On 15/05/2013 14:16, André Warnier wrote:
>> Ognjen Blagojevic wrote:
>>> Iptables will not change the URL. Iptables merely redirects all
>>> packets received on port 8080 to port 80. It will not alter the
>>> contents of the packets. Therefore, Tomcat will receive your HTTP
>>> request as it is sent by your browser -- which means it will contain
>>> port 8080 and not port 80. Tomcat processes the requests and logs the
>>> port as it is received, and that is 8080.
>> Sorry, but that seems dubious to me.
>> Tomcat does not really "receive the URL" as sent.  Tomcat (supposedly)
>> gets this connection on its port 80, and in principle has no idea that
>> the original client connection was to port 8080, no ?
> No.
> Depending on the client behaviour Tomcat will either see the full URL in
> the request line or will see hostname:port in the host header.
> Tomcat also knows which actual port the request was received on.
> Exactly which of these values gets used where depends on configuration
> including:
> - proxyHost and proxyPort on the connector
> - access log pattern
> - remote IP valve
> and AJP has different rules.
Hi Mark.
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}.
But yes, the Host header will contain a port, if different from the default 80.
So is that where Tomcat picks it up here, despite receiving the request on the (different)

port of the Connector ?

Or is there just something not clear about the OP's configuration ?

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

View raw message