halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
34.04k stars 9.71k forks source link

使用CDN后控制台无法登录 #4767

Closed Lynricsy closed 1 year ago

Lynricsy commented 1 year ago

是什么版本出现了此问题?

2.10.0

使用的什么数据库?

MySQL 8.x

使用的哪种方式运行?

Docker

在线站点地址

CDN:https://halo-cdn.foxex.cn/ CDN使用的源直接填的IP:端口 openresty反代:https://blog.foxex.cn/

发生了什么?

使用openresty反代时一打开“缓存”就无法登录控制面板,关闭“缓存”就正常了;但是现在使用upyun CDN时,即使不打开缓存也无法正常登录控制面板,看前面issue也有说无法登录的但是都是更改nginx配置文件就可以了,但是现在使用全站CDN该怎么办呢(无法登陆表现为“登陆成功”后不跳转)

相关日志输出

No response

附加信息

No response

JohnNiang commented 1 year ago

Hi @Thomitics ,方便创建一个“Guest 游客”账号看看么?

/triage needs-information

Lynricsy commented 1 year ago

Hi @Thomitics ,方便创建一个“Guest 游客”账号看看么?

/triage needs-information

没问题的,我开放了创建账号

JohnNiang commented 1 year ago

经过排查,可能是中间过程中缓存了接口请求,请看下面的接口请求响应体(尤其注意 expirescache-control):

GET https://halo-cdn.foxex.cn/apis/api.console.halo.run/v1alpha1/users/-

HTTP/2 200 
server: marco/2.20
date: Wed, 25 Oct 2023 02:18:03 GMT
content-type: application/json
vary: Accept-Encoding
x-source: C/200
cache-control: max-age=3600
x-xss-protection: 0
expires: Wed, 25 Oct 2023 03:00:05 GMT
referrer-policy: no-referrer
x-content-type-options: nosniff
x-frame-options: DENY
age: 1078
x-request-id: bf27b821aeb52e9d32c660ceed2bc39b
via: S.mix-hz-fdi1-213, T.213.H, V.mix-hz-fdi1-213, T.5.M, M.ctn-sc-yan-004
content-encoding: br
X-Firefox-Spdy: h2

正常的响应体应该如下:

HTTP/2 200 
server: marco/2.20
date: Wed, 25 Oct 2023 03:01:13 GMT
content-type: application/json
vary: Accept-Encoding
x-source: C/200
pragma: no-cache
strict-transport-security: max-age=31536000 ; includeSubDomains
cache-control: no-cache, no-store, max-age=0, must-revalidate
x-xss-protection: 0
expires: 0
referrer-policy: no-referrer
x-content-type-options: nosniff
x-frame-options: DENY
x-request-id: 98e570cce464679f61fb774f7cd2007a
via: S.mix-hz-fdi1-215, T.215.D, V.mix-hz-fdi1-213, T.2.D, M.ctn-sc-yan-004
content-encoding: br
X-Firefox-Spdy: h2

这里仅提供思路,具体原因还需要你自己排查。

ruibaby commented 1 year ago

/close

f2c-ci-robot[bot] commented 1 year ago

@ruibaby: Closing this issue.

In response to [this](https://github.com/halo-dev/halo/issues/4767#issuecomment-1807019976): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.