Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cakephp 如何防止从https://到http的意外重定向://_Cakephp_Ssl_Cloudcontrol - Fatal编程技术网

Cakephp 如何防止从https://到http的意外重定向://

Cakephp 如何防止从https://到http的意外重定向://,cakephp,ssl,cloudcontrol,Cakephp,Ssl,Cloudcontrol,我正在cloudControl上运行一个使用CakePHP(1.3)开发的web应用程序 使用他们的背负式SSL,我可以通过https://很好地访问应用程序,但所有重定向都转到http:// 如果我手动更改url,我可以通过https://访问所有内容,但这种情况只会持续到下一次发出重定向时,然后我就回到http:// 这在我的本地环境中不会发生,所以我想知道这是与cloudControl有关,还是与搭载SSL有关 如何防止被意外地从https://重定向到http://?定义完整的基本URL

我正在cloudControl上运行一个使用CakePHP(1.3)开发的web应用程序

使用他们的背负式SSL,我可以通过
https://
很好地访问应用程序,但所有重定向都转到
http://

如果我手动更改url,我可以通过
https://
访问所有内容,但这种情况只会持续到下一次发出重定向时,然后我就回到
http://

这在我的本地环境中不会发生,所以我想知道这是与cloudControl有关,还是与搭载SSL有关

如何防止被意外地从
https://
重定向到
http://

定义完整的基本URL cloudController的负载平衡器可能会侦听https请求并通过http将它们转发到您的应用程序服务器-可能会设置
X-forwadded-Proto
头。这是一个典型的设置,因此只有外部请求承担ssl加密的开销

因为它实际上是在服务器接收的http连接上,所以由路由器生成的任何绝对URL(例如)在默认情况下都将使用
http://
,而不是
https://
,因为这是访问应用程序服务器的协议

若要覆盖此选项,请定义要用作应用程序绝对根的url,以便

i、 e.将以下内容放入应用程序引导程序中:

define('FULL_BASE_URL', 'https://example.com');

很抱歉迟了答复。我刚试过,效果很好。谢谢