宝塔面板(9.0.0)在域名部署下开启反代缓存会出现登陆会话管理问题 #5986
Replies: 1 comment
-
提示一下,服务器上使用各类面板部署/配置LobeChat,并出现缓存相关问题的都要自行检查一下反代缓存文件夹有没有文件以确定是否开启了缓存。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
测试环境
问题产生过程
🚫 以下为经测试会引发风险的缓存配置留档,请勿使用。 | 🚫 The following is a documentation of caching configurations that have been tested to pose risks. Please do not use them.
问题定位为
proxy_ignore_headers Set-Cookie Cache-Control expires X-Accel-Expires;
会造成 Cache 控制失效在去除该行后,则会引发登陆后无法keep session的问题
#GLOBAL-CACHE START proxy_cache lobe_rd2_top_cache; proxy_cache_key $host$uri$is_args$args; - proxy_ignore_headers Set-Cookie Cache-Control expires X-Accel-Expires; proxy_cache_valid 200 304 301 302 5m; proxy_cache_valid 404 1m; location ~ .*\.(css|js|jpe?g|gif|png|webp|woff|eot|ttf|svg|ico|css\.map|js\.map)$ { expires 5m; error_log /dev/null; access_log /dev/null; } #GLOBAL-CACHE END
Testing Environment
Issue Generation Process
🚫 The following is a documentation of caching configurations that have been tested to pose risks. Please do not use them. | 🚫 以下为经测试会引发风险的缓存配置留档,请勿使用。
The issue is identified as
proxy_ignore_headers Set-Cookie Cache-Control expires X-Accel-Expires;
, which causes cache control to fail.Removing this line leads to issues with session persistence after login.
#GLOBAL-CACHE START proxy_cache lobe_rd2_top_cache; proxy_cache_key $host$uri$is_args$args; - proxy_ignore_headers Set-Cookie Cache-Control expires X-Accel-Expires; proxy_cache_valid 200 304 301 302 5m; proxy_cache_valid 404 1m; location ~ .*\.(css|js|jpe?g|gif|png|webp|woff|eot|ttf|svg|ico|css\.map|js\.map)$ { expires 5m; error_log /dev/null; access_log /dev/null; } #GLOBAL-CACHE END
Beta Was this translation helpful? Give feedback.
All reactions