You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Nginx secure_link做认证代理时Grafana静态文件401报错

问题:Nginx作为Grafana认证代理,静态文件加载返回401错误

我尝试配置Nginx作为认证代理实现Grafana自动登录,目前认证已成功,但Grafana加载静态文件时全部返回401错误。

以下是我的Nginx配置:

# 我也尝试过在grafana.ini里启用/grafana路径的配置
location / {
    secure_link $arg_md5,$arg_expires;
    secure_link_md5 "$secure_link_expires$uri enigma";
    if ($secure_link = "") { return 403; }
    if ($secure_link = "0") { return 410; }
    proxy_pass http://localhost:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Session-Token $http_x_session_token;
    proxy_set_header X-WEBAUTH-USER $arg_user;
    proxy_set_header Authorization "";
    # rewrite ^/auth(.*)$ /$1;       
}

我使用的认证链接如下:

http://localhost/?md5=JSyq8fW04y5L7Khd0BoZ9g&expires=1686614400&user=admin

内容的提问来源于stack exchange,提问作者Saqy G

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 18:52:02