添加 Grafana 10+ 的 CORS/跨域配置,解决通过 Nginx 反向代理访问时的 "origin not allowed" 错误。 Changes: - docker-compose.monitoring.yml: 添加 Grafana 安全配置 - GF_SECURITY_ALLOW_EMBEDDING=true: 允许嵌入和反向代理访问 - GF_SECURITY_COOKIE_SAMESITE=none: 允许跨域 Cookie - GF_SECURITY_COOKIE_SECURE=true: HTTPS 下安全传输 Cookie - GF_AUTH_ANONYMOUS_ENABLED=false: 保持安全性,禁用匿名访问 - .env.example: 添加重启提示说明 - 强调修改 GRAFANA_ROOT_URL 后必须重启监控服务 - README.md: 新增 "Grafana 通过 Nginx/域名访问配置" 章节 - 详细说明配置步骤 - 提供验证方法 - 列出常见错误和解决方案 问题根因: Grafana 10+ 引入了更严格的安全策略,要求显式配置 CORS 相关参数才能通过反向代理访问。 仅配置 GF_SERVER_ROOT_URL 不足以解决跨域问题。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| backend | ||
| docs | ||
| frontend | ||
| kubernetes | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| README.md | ||
| docker-compose.yml | ||