Reverse Proxy

My TYPO3 websites are hosted on a webserver located behind a reverse-proxy, namely  pound.

With this configuration, TYPO3 logs show as client IP the IP of the reverse proxy instead of the IP of the client himself.

In order to fix this detail, a minor change needs to be written to file /t3lib/class.t3lib_div.php for the function getIndpEnv($getEnvName):

case 'REMOTE_ADDR':
$retVal = $_SERVER['HTTP_X_FORWARDED_FOR'];
break;
// These are let through without modification case 'REMOTE_HOST': case 'HTTP_REFERER': case 'HTTP_HOST': case 'HTTP_USER_AGENT': case 'HTTP_ACCEPT_LANGUAGE': case 'QUERY_STRING': $retVal = $_SERVER[$getEnvName]; break;
Flattr