Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务器配置https 并且 通过阿里云 https cdn之后, 会出现 https 判断语句失效 #338

Closed
shoaly opened this issue Mar 15, 2016 · 2 comments

Comments

@shoaly
Copy link
Contributor

shoaly commented Mar 15, 2016

我用的环境

centos
PHP 版本:
php 5.7
overtrue/wechat 版本:2.x

问题及现象

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';

代码中判断 当前 是https 和 http 的代码 会在服务器 上https 并且 挂 阿里云 https cnd的时候失效, 阿里云要通过判断:
if(Request::server('HTTP_X_CLIENT_SCHEME') == 'https') 去判断 才正常
描述你的问题现象,报错贴截图粘贴或者贴具体信息

@shoaly shoaly changed the title 服务器配置https 并且 通过阿里云 https cdn之后, 会出现 http判断 服务器配置https 并且 通过阿里云 https cdn之后, 会出现 https 判断语句失效 Mar 15, 2016
@shoaly shoaly closed this as completed Mar 15, 2016
@zeasly
Copy link

zeasly commented Mar 8, 2017

为什么把问题关闭了呢 我也遇到了

@shoaly
Copy link
Contributor Author

shoaly commented Mar 8, 2017

@zeasly 因为api 已经升级到3.0了吧, 好像马上就要变成4.0...
我现在在用3.0 , 为了避免同样的问题, 我都取消 阿里云的https了, 一方面是兼容性, 另一方面我现在用的是letsencrypt 的证书3个月就过期, 还得往阿里云上同步 太麻烦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants