Q:

Strange Tomcat trailing slash redirect domain handling

I have a Tomcat 6 webserver running my application and I am seeing some very strange redirect behaviour. 
I expect to access my application at the internal URL http://appteam.testdomain.co.uk/test and that this will return a 302 redirect to http://appteam.testdomain.co.uk/test/ which then serves up index.html, the front page of the application. 
However, a GET for http://appteam.testdomain.co.uk/test currently returns a 302 to http://appteam.testdomain.co.ukteam.testdomain.co.uk/test/
How would I debug this weird redirect and what Tomcat config could possibly be causing this behaviour? 
EDIT
For clarity the strangeness here is that a request for 
http://appteam.testdomain.co.uk/test 

is being redirected to 
http://appteam.testdomain.co.ukteam.testdomain.co.uk/test/

Note the mangled domain. 
EDIT2
@Sean - I am not doing the redirect myself.  Something deep within Tomcat seems to be handling this for me.  Let me know which parts of the various Tomcat XML files would help to diagnose this and I will post them. 

A:

I have worked out the answer and it is very specific to the way my app is deployed.  Tomcat sits behind an NGINX proxy which forwards almost all traffic to Tomcat.  The Proxy is used to handle some URLs differently.  It turns out that Tomcat is returning a correct 302 to 
http://appteam.testdomain.co.uk/test/

but the NGINX proxy is mangling this into
http://appteam.testdomain.co.ukteam.testdomain.co.uk/test/

