When loading resources in debug mode, the HTTP_HOST should be used instead of SERVER_NAME. Besides the port issue, SERVER_NAME is the internal name of the host on the server, this can differ from where the user requested the site from. (i.e. SERVER_NAME is myhost.local, but the user requested myhost.com)
When loading resources in debug mode, the HTTP_HOST should be used instead of SERVER_NAME. Besides the port issue, SERVER_NAME is the internal name of the host on the server, this can differ from where the user requested the site from. (i.e. SERVER_NAME is myhost.local, but the user requested myhost.com)