Posted at

AWS 用の Zend_Controller_Request

More than 5 years have passed since last update.

ELB経由だとSSL判定がアレなので上書き。


Proxy.php

<?php

require_once 'Zend/Controller/Request/Http.php';

/**
* My_Controller_Request_Proxy
*/

class My_Controller_Request_Proxy extends Zend_Controller_Request_Http
{
/**
* Is https secure request
* @return boolean
*/

public function isSecure()
{
return (parent::isSecure()
|| $this->getServer('HTTP_X_FORWARDED_PROTO') === parent::SCHEME_HTTPS);
}
}


設定はBootstrapとかに書けばいいんじゃないかな。


Bootstrap.php

$frontController->setRequest(new My_Controller_Request_Proxy());