tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Goyal -X (anigoyal - Aricent Technologies at Cisco)" <anigo...@cisco.com>
Subject redirect request from 8080 to port 80
Date Wed, 15 May 2013 11:42:10 GMT
Hi,

We are using tomcat version 7.0.25 and in server.xml, we have two connector port defined:80
(http)and 443(https).
In /etc/sysconfig/iptables, we have redirect logic written that will redirect the request
coming at port 8080 to port 80, and request coming at port 8443 to 443.
-A PREROUTING -p tcp -m tcp --dport 8443 -j REDIRECT --to-ports 443
-A PREROUTING -p tcp -m tcp --dport 8080 -j REDIRECT --to-ports 80

Now when I hit the url 'http://request-uri:8080/context, then I am getting the desire response.
I have below query:

1.       Will the request firstly go to iptables before tomcat ?

2.       If request firstly go to iptable then it check that 8080 is redirect to port 80 then
url change to 'http://request-uri:80/context' and it then land to tomcat and tomcat respond
to it. Now in tomcat access logs, the requesting port corresponding to this request is 8080.
So why it is 8080 in tomcat access logs.? Please revert on this. I think because iptables
redirect 8080 to 80 so tomcat receives the request at port 80 so in tomcat access logs, requestiong
port should be 80.
Thanks
Anil

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message