Request URI port detection update.

In the case of NAT redirection where server port is not the same as the accessing one, detect the port in the url first.