wordpress开启Https访问无限重定向问题
一、问题现象
在nginx代理配置了ssl证书,并通过https访问wordpress发现页面加载一直在重定向。
二、问题分析
wordpress是通过docker部署的,监听8080端口,且nginx转发的地址(proxy_pass)是http://127.0.0.1:8080,所以wordpress识别访问方式是http而非https,导致该问题产生。
三、解决方法
通过修改wp源代码解决
1通过修改wp源代码解决
1、打开wordpress安装目录下的wp-includes/load.php文件
2、找到is_ssl()函数
3、将return false 改为 return true

4、重启web服务器
————————————————
This message is used to verify that this feed (feedId:72591216059646976) belongs to me (userId:72528595183663104). Join me in enjoying the next generation information browser https://follow.is.