禅道https无法登录解决但是http访问正常

通过源代码部署禅道,从15.0.3升级15.6后,原有正常的https访问无法登录了,也不提示错误

 

部署方式为  nginx(443)做ssl卸载  ->  apache(80)->php

 

升级15.6后,使用 https://zentao.xxx.com登录异常,使用http://zentao.xxx.com登录没问题。

 进入到禅道的根目录,我的是/data/zentao/www/这是我docker映射到外部的,也就是zentaopms下面

注释掉下面的三行

vim /data/zentao/www/framework/base/router.class.php
#找到https
/* Change for CSRF. */
if($this->config->framework->filterCSRF)
{
//$httpType = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https';
if(isset($_SERVER['REQUEST_SCHEME']) and strtolower($_SERVER['REQUEST_SCHEME']) == 'https') $httpType = 'https';

//$httpHost = zget($_SERVER, 'HTTP_HOST', '');
$apiMode = (defined('RUN_MODE') && RUN_MODE == 'api') || isset($_GET[$this->config->sessionVar]);
//if(!$apiMode && (empty($httpHost) or strpos($this->server->http_referer, "$httpType://$httpHost") !== 0)) $_FILES = $_POST = array();
}

 参考文档:https://www.zentao.net/ask/36770.html

posted @ 2021-12-30 11:28  努力乄小白  阅读(1847)  评论(0编辑  收藏  举报