ZF2-508: Return proper server host name when behind a proxy


\Zend\View\Helper\ServerUrl does not take into account when the request is coming from a proxy server. Here is that patch.

        if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && !empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
            $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
            if (strpos($host, ',')) {
                // See Symfony ticket #3842 (
                $hosts = explode(',', $host);
                $host = array_pop($hosts);
        } elseif (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) {


This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: