下面配置可以正常运行:
用 caddy 代理到了公网:
auth.xx.com {
reverse_proxy localhost:9091
}
auth.xx.com 正常访问登陆。
需要认证的网站:
app.xx.com {
forward_auth http://localhost:9091 {
uri /api/verify?rd=https://auth.xx.com
}
reverse_proxy localhost:3002
}
也可以正常访问登陆。
把
http://localhost:9091
换成了
https://auth.xx.com
后,打开app.xx.com
直接跳过了鉴权,进入到里边了。
authelia 日志什么都没输出,应该是访问没到达 authelia ,猜测是请求头问题, 瞎改了几个请求头,发现可以跳转到认证登陆页面,但提示:"!检索当前用户状态时出现问题"(不能正常登陆)
我一直搞不懂请求头,所以想问问大佬的看法。
![]() |
1
Oct31Dec25 OP 网页访问: https://auth.xx.com/api/verify
显示 200 OK |
![]() |
2
Oct31Dec25 OP 已解决:
认证端代理 ``` auth.xx.com { reverse_proxy localhost:9091 { trusted_proxies 1.1.1.1/32 2.2.2.2/32 header_up Host {upstream_hostport} } } ``` APP 端代理 ``` app.xx.com { forward_auth https://auth.xx.com { uri /api/authz/forward-auth? header_up Host {upstream_hostport} } reverse_proxy localhost:3002 } ``` |