what do you mean by that? running on another port than 443 or 80? Shouldn't be a problem or maybe i'm not getting the issue correctly.
You assumptions were totally legitimate with the double slashes by the way. I think it's something that's not only a feature in nginx but a browser adopted common practice now to treat them as single (at least try and deliver if a 200 is hit)
$_SERVER['SERVER_PORT'] should contain the port number (if you are running apache2, you must have UseCanonicalName and UseCanonicalPhysicalPort set to On in order to get the real physical port, i hate apache)