tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ognjen Blagojevic <ognjen.d.blagoje...@gmail.com>
Subject Re: redirect request from 8080 to port 80
Date Wed, 15 May 2013 14:28:23 GMT
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.


> But yes, the Host header will contain a port, if different from the
> default 80.

Right.


> So is that where Tomcat picks it up here, despite receiving the request
> on the (different) port of the Connector ?

Yes. You may take a look at 
AbstractHttp11Processor.parseHost(MessageBytes). If the host header is 
not set (e.g. client uses HTTP 1.0), Tomcat will set port to the one 
read from endpoint configuration. If the client uses HTTP 1.1, where 
host header is mandatory, Tomcat will read host header. If there is a 
port specified in the value of the host header it will be read. If there 
is no port specified in the host header that Tomcat will assume port 80 
for HTTP and port 443 for HTTPS.


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

I have no explanation why the OP is using iptables prerouting inversly 
of what is their common usage with Tomcat.

-Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message