In the case of nat redirection where server port is not the same as the accessing one, detect the port in the url first.
remote the use of SERVER_PORT in port detection.
Merge pull request #6 from oodgaard/detectPort

Request URI port detection update.