-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Nginx 反代 + auth_basic 时 401 错误 #3829
Nginx 反代 + auth_basic 时 401 错误 #3829
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
因为后端也使用了 Authorization头传递token,这与basic auth冲突。 |
@xhofe 非常感谢提供思路 然后我用curl测试了一下,发现如果加认证访问
从下面这nginx的log来看,401不是back_end发出的,而是nginx直接给出的401,说明客户端那边在请求 Click to expand the logs[info] 3295616#3295616: *55041 no user/password was provided for basic authentication, client: 127.0.0.1, server: ~^(alist)\d{0,1}.domain.com$, request: "GET /api/public/settings HTTP/2.0", host: "alist9.domain.com", referrer: "https://alist9.domain.com/" 这个log可以判断访问root Click to expand the logs[debug] 3295616#3295616: 55041 http proxy header: " |
Hello @myfingerhurt, this issue will not be worked on and will be closed. |
希望能够兼容一下哈~ |
@myfingerhurt 请问一下现在/api这个uri加上认证后可以200了,不加401,不就说明nginx的basic auth生效了么,为什么你却说“排查: 发现是/api路径遭遇了401错误,猜测是调用api时没有继承浏览器的session?加了这个临时绕开,但是显然API也是必须要受到第一层密码保护的”,为什么是又被绕过了呀 |
same issue,不是401,而是nginx不断弹出认证窗口,猜测Authorization字段被alist覆写了 |
我也遇到了这个问题 ,我通过nginx反代开放服务,以达到隐藏webcms特征目的。 但我发现alist服务认证也是使用了Authorization:头来放置jwt认证。 我测试了,一个请求只能有一个Authorization:头,而且只能放置一种认证方式。也就说说两种认证方式不能同时出现。 以下方式都是不行的:
也是行不通的
目前已知能让两重认证兼容的方式就是修改 请求头标示。即:改掉nginx的 |
@myfingerhurt 这种结构有两个好处: 我目前采用的是proxy或vpn方案,需要安装软件和配置较为繁琐,对于普通用户操作上并不友好,且在跨平台win,mac,Mobile上并不友好。且我不能让临时用户访问我的LAN,进行授权配置更加繁琐。而我上述场景只需要在browser上 通过两次login即可。对用户来说是简单的,对运维来说也是相对安全的。 所以希望未来alist能够支持将 |
Please make sure of the following things
alist
and not something else(such asDependencies
orOperational
).Alist Version / Alist 版本
v3.13.2
Driver used / 使用的存储驱动
local
Describe the bug / 问题描述
点击展开配置文件
}
同时qBittorrent的WebUI, 以及nastools使用这种两层密码的反代方式完全没有问题。
Failed fetching settings: Request failed with status code 401
/api
路径遭遇了401错误,猜测是调用api时没有继承浏览器的session?加了这个临时绕开,但是显然API也是必须要受到第一层密码保护的
作为参考,这里是qBittorrent的反代设置
Reproduction / 复现链接
401错误卡在/api/public/settings
加入bypass后
Logs / 日志
No response
The text was updated successfully, but these errors were encountered: