I'm running into the same problem. Digging a bit further into it (with firebug on firefox) I was able to see that the page comes back correctly, but the HTML contains a line at the very end that (I believe) triggers the buggy redirect. These are the last 4 lines of it:
<script>
window.setup_home_page({"TeamURL":"https://hdblx086:49181/myteam","Title":"My Team- Home"});
</script>
</body>
</html>
where 'hdblx' corresponds to the URL I'm using to proxy the requests to in my nginx setup. In principle my setup looks like that of 'pbruna'. I have no clue why mattermost inserts this redirect, but maybe someone know how to provide a proper nginx directive for telling mattermost what the effectively used URL is.I would have guessed that "proxy_set_header" does the job, but maybe it isn't.