Thanks. I just added "proxy_redirect off" in the http block and now it works as intended. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,77967,77976#msg-77976