I have a "special" setup on my servers where I have a proxy sitting in front of the cache which in term fetches data from the actual web service.
After installing a SSL certificate @ the proxy level, I had some difficulty maintaining the 'https' directive in front of the redirects.
It turned out that Yii considered it was not running on a secure connection because the web service it is running on is serving pages using the http protocol. However, these pages are served internally to the cache server which serves them to the proxy where the SSL encryption takes place.
After looking into the available variables, I found that
So I replaced CHttpRequest::getIsSecureConnection() with the following:
That does the trick for me.
I am not reporting it as a bug or an issue, just logging it here for info.
After installing a SSL certificate @ the proxy level, I had some difficulty maintaining the 'https' directive in front of the redirects.
It turned out that Yii considered it was not running on a secure connection because the web service it is running on is serving pages using the http protocol. However, these pages are served internally to the cache server which serves them to the proxy where the SSL encryption takes place.
After looking into the available variables, I found that
$_SERVER['HTTP_X_FORWARDED_PROTO']could tell the tale.
So I replaced CHttpRequest::getIsSecureConnection() with the following:
/** * Return if the request is sent via secure channel (https). * @return boolean if the request is sent via secure channel (https) */ public function getIsSecureConnection() { return (!empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off')) || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'],'https')==0) ; }
That does the trick for me.
I am not reporting it as a bug or an issue, just logging it here for info.