gpt4 book ai didi

Magento有一个重定向循环

转载 作者:行者123 更新时间:2023-12-03 21:28:05 24 4
gpt4 key购买 nike

我的Magento网站主页出现重定向循环错误。当我尝试打开它时,它转到我的旧服务器URL并给出错误:

The webpage resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.



当我尝试进入管理员帐户时,它将带我到旧服务器的管理员URL,没有任何错误。

我下载了新数据库并将其连接到商店,它可以正常工作,但是当我将其连接到旧数据库时,它会给出相同的错误。

请给我提意见。

最佳答案

这不是一个理想的解决方案,但是我遇到了Magento 1.9.x的问题。

设置为:Nginx Proxy & SSL Terminator => Apache Webserver
无论我启用SSL做什么,都会导致重定向循环。我将问题缩小到Magento,而不是Nginx配置。

就像Magento一样,即使设置了正确的 header ,也不知道它正在接收来自Nginx的安全连接。

肮脏的解决方案是将一些代码添加到magento根目录中index.php的最底部(即/var/www/magento),就在Mage::run...行之前,如下所示:

if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}

Mage::run($mageRunCode, $mageRunType);

关于Magento有一个重定向循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16507584/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com