That was exactly the problem. The app was causing the redirect. Thanks a ton. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229127,229168#msg-229168