1Panel icon indicating copy to clipboard operation
1Panel copied to clipboard

[BUG]内网穿透环境使用WAF出现500报错

Open likesrt opened this issue 1 year ago • 1 comments

联系方式

[email protected]

1Panel 版本

专业版:V1.10.5-lts

问题描述

在内网环境部署1Panel和halo后。使用frp进行内网穿透。在外网访问halo。无法登录halo控制台。查看请求响应为500. 关闭halo网站的参数规则,xss防御,sql注入 依旧无法登录。单独关闭halo网站waf功能,无法登录。只有全局关闭waf后可以登录。 还有另一种解决方式。 在OpenResty配置文件http块新增下面用来获取客户端X-Forwarded-For请求头的配置,就可以正常登录了。

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;

关联1Panel + FRP 内网穿透建站遇到的问题

重现步骤

在内网环境部署1Panel和halo后。使用frp进行内网穿透。在外网访问halo。无法登录halo控制台。

期待的正确结果

正常登录

相关日志输出

2024/04/29 00:20:54 [error] 853#853: *715034 lua entry thread aborted: runtime error: ./waf.lua:148: Expected value but found invalid token at character 1
stack traceback:
coroutine 0:
	[C]: in function 'decode'
	./waf.lua:148: in function 'waf_api'
	./waf.lua:172: in main chunk, client: 127.0.0.1, server: halo.broue.cn, request: "POST /login HTTP/1.1", host: "halo.broue.cn", referrer: "https://halo.broue.cn/console/login?login-type=password"

附加信息

No response

likesrt avatar Apr 28 '24 17:04 likesrt

您好 是获取不到真实 IP 导致的 后续版本修复

zhengkunwang223 avatar Apr 29 '24 03:04 zhengkunwang223

v1.10.7-lts 版本已发布。

wanghe-fit2cloud avatar May 10 '24 08:05 wanghe-fit2cloud