Oh ho ho, turning the table around on me, are we? It's a matter of comparing whether or not to trust proxied data (in which case we can assume a proxy is being used if the port is set), vs serving an url with a port or not.

In the former case, it's okay if we're wrong (e.g. if the app trusts proxy data, but isn't proxied, no harm done), whereas in the latter case, if we're wrong (e.g. nginx is proxying port 80 to port 4567), printed URLs in the app are incorrect.