Try the direct IP address in upstream, if that works (port is kept) then it is for sure a dns issue.
It might be an application issue, for example you get data on port 8000 and proxy this to 9000 but the application expects data on 8000 so after the first connect the application removes 9000 and re-inserts 8000, this is typical tomcat behavior until you tell the tomcat application data is coming from 9000.
It might be an application issue, for example you get data on port 8000 and proxy this to 9000 but the application expects data on 8000 so after the first connect the application removes 9000 and re-inserts 8000, this is typical tomcat behavior until you tell the tomcat application data is coming from 9000.