VPS侦探论坛

 找回密码
 注册
查看: 5125|回复: 11

discuzx3.1开启https部分页面陷入重复302~301

[复制链接]
发表于 2016-11-22 10:50:16 | 显示全部楼层 |阅读模式

军哥的论坛可以开通成功有什么经验吗?

我curl -IL http://www.aaaaaa.com/news/
发现错误如下:
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Tue, 22 Nov 2016 02:39:53 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
X-Powered-By: PHP/5.4.41
Set-Cookie: pre_8745_saltkey=fRKO9955; expires=Thu, 22-Dec-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure; httponly
Set-Cookie: pre_8745_lastvisit=1479778793; expires=Thu, 22-Dec-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
Set-Cookie: pre_8745_sid=SPaYO5; expires=Wed, 23-Nov-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
Set-Cookie: pre_8745_lastact=1479782393%09index.php%09list; expires=Wed, 23-Nov-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
location: http://www.aaaaaa.com/news/

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 22 Nov 2016 02:39:53 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://www.aaaaaa.com/news/

HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Tue, 22 Nov 2016 02:39:53 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
X-Powered-By: PHP/5.4.41
Set-Cookie: pre_8745_saltkey=m11Rrd7p; expires=Thu, 22-Dec-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure; httponly
Set-Cookie: pre_8745_lastvisit=1479778793; expires=Thu, 22-Dec-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
Set-Cookie: pre_8745_sid=Muu727; expires=Wed, 23-Nov-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
Set-Cookie: pre_8745_lastact=1479782393%09index.php%09list; expires=Wed, 23-Nov-2016 02:39:53 GMT; path=/; domain=.aaaaaa.com; secure
location: http://www.aaaaaa.com/news/

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 22 Nov 2016 02:39:53 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://www.aaaaaa.com/news/

curl: (47) Maximum (50) redirects followed



一直以为是80端口跳转问题,但是换了NNNN多方案,错误依旧。
又将伪静态设置抡了NNNN遍,最终放弃,智商有限吖。

军哥求救!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-11-22 11:26:20 | 显示全部楼层


我这论坛是discuz 6的
发你的配置文件看看,discuz x后台及ucenter上好像都需要修改
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-11-22 11:43:42 | 显示全部楼层

网站程序源文件里所有的http://www.aaaaaa.com都用DW批量修改成了https://www.aaaaaa.com
包括config下的所有设置。
后台站点信息里有网站网址的设置,也变更了,域名设置也保证已经更改,ucenter的地址,及ucenter_server的应用管理也都改了。
发现在界面-导航设置里,与http://www.aaaaaa.com/news/相关的频道网址设置,一直显示http://www.aaaaaa.com/news/,点击编辑无法修改网址,进入mysql修改为https://www.aaaaaa.com/news/,但是后台一刷新,又自动变回http://www.aaaaaa.com/news/。非常奇怪,这个频道的网址设置,应当还有一个什么地方是总开关吧
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-11-22 11:46:48 | 显示全部楼层



我直接curl -IL https://www.aaaaaa.com/news/ ,发现还是会跳转到http://www.aaaaaa.com/news/。所以应该是这里的导航链接设置根本没用
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-11-22 11:57:15 | 显示全部楼层

从主楼的302状态信息来看,应该是discuzx的程序设置了跳转的?

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-11-22 12:02:01 | 显示全部楼层

我帖config_gobal.php的上来吧,军哥看看

<?php
$_config = array();
// ----------------------------  CONFIG DB  ----------------------------- //
$_config['db']['1']['dbhost'] = 'localhost';
$_config['db']['1']['dbuser'] = '*****';
$_config['db']['1']['dbpw'] = '******';
$_config['db']['1']['dbcharset'] = 'utf8';
$_config['db']['1']['pconnect'] = '0';
$_config['db']['1']['dbname'] = '****';
$_config['db']['1']['tablepre'] = 'pre_';
$_config['db']['common']['slave_except_table'] = '';
$_config['db']['slave'] = '';

// --------------------------  CONFIG MEMORY  --------------------------- //
$_config['memory']['prefix'] = 'ojvJd7_';
$_config['memory']['eaccelerator'] = 0;
$_config['memory']['apc'] = 0;
$_config['memory']['xcache'] = 0;
$_config['memory']['memcache']['server'] = 0;
$_config['memory']['memcache']['port'] = 11211;
$_config['memory']['memcache']['pconnect'] = 1;
$_config['memory']['memcache']['timeout'] = 1;
$_config['memory']['redis']['server'] = '';
$_config['memory']['redis']['port'] = 6379;
$_config['memory']['redis']['pconnect'] = 1;
$_config['memory']['redis']['timeout'] = '0';
$_config['memory']['redis']['requirepass'] = '';
$_config['memory']['redis']['serializer'] = 1;
$_config['memory']['wincache'] = 0;

// --------------------------  CONFIG SERVER  --------------------------- //
$_config['server']['id'] = 1;

// -------------------------  CONFIG DOWNLOAD  -------------------------- //
$_config['download']['readmod'] = 2;
$_config['download']['xsendfile']['type'] = '0';
$_config['download']['xsendfile']['dir'] = '/down/';

// ---------------------------  CONFIG CACHE  --------------------------- //
$_config['cache']['type'] = 'sql';

// --------------------------  CONFIG OUTPUT  --------------------------- //
$_config['output']['charset'] = 'utf-8';
$_config['output']['forceheader'] = 1;
$_config['output']['gzip'] = '1';
$_config['output']['tplrefresh'] = 1;
$_config['output']['language'] = 'zh_tw';
$_config['output']['staticurl'] = 'static/';
$_config['output']['ajaxvalidate'] = '0';
$_config['output']['iecompatible'] = '0';

// --------------------------  CONFIG COOKIE  --------------------------- //
$_config['cookie']['cookiepre'] = 'pre_';
$_config['cookie']['cookiedomain'] = '.aaaaaa.com';
$_config['cookie']['cookiepath'] = '/';

// -------------------------  CONFIG SECURITY  -------------------------- //
$_config['security']['authkey'] = '******';
$_config['security']['urlxssdefend'] = 1;
$_config['security']['attackevasive'] = '0';
$_config['security']['querysafe']['status'] = 1;
$_config['security']['querysafe']['dfunction']['0'] = 'load_file';
$_config['security']['querysafe']['dfunction']['1'] = 'hex';
$_config['security']['querysafe']['dfunction']['2'] = 'substring';
$_config['security']['querysafe']['dfunction']['3'] = 'if';
$_config['security']['querysafe']['dfunction']['4'] = 'ord';
$_config['security']['querysafe']['dfunction']['5'] = 'char';
$_config['security']['querysafe']['daction']['0'] = 'intooutfile';
$_config['security']['querysafe']['daction']['1'] = 'intodumpfile';
$_config['security']['querysafe']['daction']['2'] = 'unionselect';
$_config['security']['querysafe']['daction']['3'] = '(select';
$_config['security']['querysafe']['daction']['4'] = 'unionall';
$_config['security']['querysafe']['daction']['5'] = 'unionall';
$_config['security']['querysafe']['daction']['6'] = 'uniondistinct';
$_config['security']['querysafe']['dnote']['0'] = '/*';
$_config['security']['querysafe']['dnote']['1'] = '*/';
$_config['security']['querysafe']['dnote']['2'] = '#';
$_config['security']['querysafe']['dnote']['3'] = '--';
$_config['security']['querysafe']['dnote']['4'] = '"';
$_config['security']['querysafe']['dlikehex'] = 1;
$_config['security']['querysafe']['afullnote'] = 1;

// --------------------------  CONFIG ADMINCP  -------------------------- //
// -------- Founders: $_config['admincp']['founder'] = '1,2,3'; --------- //
$_config['admincp']['founder'] = '1';
$_config['admincp']['forcesecques'] = '0';
$_config['admincp']['checkip'] = 0;
$_config['admincp']['runquery'] = 1;
$_config['admincp']['dbimport'] = 1;

// --------------------------  CONFIG REMOTE  --------------------------- //
$_config['remote']['on'] = '0';
$_config['remote']['dir'] = 'remote';
$_config['remote']['appkey'] = '*************';
$_config['remote']['cron'] = '0';

// ---------------------------  CONFIG INPUT  --------------------------- //
$_config['input']['compatible'] = 1;
// -------------------  THE END  -------------------- //

?>
 楼主| 发表于 2016-11-22 14:45:59 | 显示全部楼层

将门户频道生成index.html後,访问可以打开,可见应当是门户频道下的动态文件index.php的某些参数导致跳转到http://.
index.php代码如下:
<?php
chdir('../');
define('SUB_DIR', '/news/');
$_GET['mod'] = 'list';
$_GET['catid'] = '14';
require_once './portal.php';
?>
目前./portal.php内容正常打开。因此不会是引用的文件导致跳转,只能是chdir()及以下三行代码导致。

[ 本帖最后由 yanqzh 于 2016-11-22 14:51 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-11-22 16:35:28 | 显示全部楼层

discuz 6.0没改几个地方,discuz x 只能自己慢慢调试了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-12-7 18:22:56 | 显示全部楼层


军哥,可以帮忙调试一下吗?我QQ438378316
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-12-8 09:32:34 | 显示全部楼层

回复 9# 的帖子




付费服务联系qq或旺旺
 楼主| 发表于 2017-1-2 23:09:18 | 显示全部楼层

开启PHP错误日志查看到以下提示:
Notice: Use of undefined constant DISCUZ_ROOT - assumed 'DISCUZ_ROOT' in /home/wwrot/www/news/index.php on line 2 Warning: require(DISCUZ_ROOT./indexnews.php): failed to open stream: No such file or directory in /home/wwrot/www/news/index.php on line 2 Fatal error: require(): Failed opening required 'DISCUZ_ROOT./indexnews.php' (include_path='.:/usr/local/php/lib/php') in /home/wwrot/www/news/index.php on line 2
发表于 2017-1-3 11:54:15 | 显示全部楼层

回复 11# 的帖子


上面有提示No such file or directory文件不存在
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 03:28 , Processed in 0.028940 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表