WordPress with ssl-cert behind reverse proxy

In case your reverse proxy handles the ssl certs you have to add following lines to your wp-config.php of your wordpress installation:

/*
Handle SSL reverse proxy
*/
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
}